diff options
Diffstat (limited to 'ext')
260 files changed, 5619 insertions, 9973 deletions
diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c index 7ef30cad5e..5c4e8740e4 100644 --- a/ext/bcmath/bcmath.c +++ b/ext/bcmath/bcmath.c @@ -209,14 +209,14 @@ PHP_FUNCTION(bcadd) zend_long scale_param = 0; bc_num first, second, result; size_t left_len, right_len; - int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS(); + 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) { return; } if (argc == 3) { - scale = (int) ((int)scale_param < 0) ? 0 : scale_param; + scale = (int) (scale_param < 0 ? 0 : scale_param); } bc_init_num(&first TSRMLS_CC); @@ -246,14 +246,14 @@ PHP_FUNCTION(bcsub) size_t left_len, right_len; zend_long scale_param = 0; bc_num first, second, result; - int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS(); + 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) { return; } if (argc == 3) { - scale = (int) ((int)scale_param < 0) ? 0 : scale_param; + scale = (int) ((int)scale_param < 0 ? 0 : scale_param); } bc_init_num(&first TSRMLS_CC); @@ -283,14 +283,14 @@ PHP_FUNCTION(bcmul) size_t left_len, right_len; zend_long scale_param = 0; bc_num first, second, result; - int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS(); + 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) { return; } if (argc == 3) { - scale = (int) ((int)scale_param < 0) ? 0 : scale_param; + scale = (int) ((int)scale_param < 0 ? 0 : scale_param); } bc_init_num(&first TSRMLS_CC); @@ -320,14 +320,14 @@ PHP_FUNCTION(bcdiv) size_t left_len, right_len; zend_long scale_param = 0; bc_num first, second, result; - int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS(); + 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) { return; } if (argc == 3) { - scale = (int) ((int)scale_param < 0) ? 0 : scale_param; + scale = (int) ((int)scale_param < 0 ? 0 : scale_param); } bc_init_num(&first TSRMLS_CC); @@ -411,11 +411,11 @@ PHP_FUNCTION(bcpowmod) php_str2num(&second, right TSRMLS_CC); php_str2num(&mod, modulous TSRMLS_CC); - scale_int = (int) ((int)scale < 0) ? 0 : scale; + scale_int = (int) ((int)scale < 0 ? 0 : scale); if (bc_raisemod(first, second, mod, &result, scale_int TSRMLS_CC) != -1) { if (result->n_scale > scale) { - result->n_scale = scale; + result->n_scale = (int)scale; } RETVAL_STR(bc_num2str(result)); } else { @@ -438,14 +438,14 @@ PHP_FUNCTION(bcpow) size_t left_len, right_len; zend_long scale_param = 0; bc_num first, second, result; - int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS(); + 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) { return; } if (argc == 3) { - scale = (int) ((int)scale_param < 0) ? 0 : scale_param; + scale = (int) ((int)scale_param < 0 ? 0 : scale_param); } bc_init_num(&first TSRMLS_CC); @@ -475,14 +475,14 @@ PHP_FUNCTION(bcsqrt) size_t left_len; zend_long scale_param = 0; bc_num result; - int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS(); + 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) { return; } if (argc == 2) { - scale = (int) ((int)scale_param < 0) ? 0 : scale_param; + scale = (int) ((int)scale_param < 0 ? 0 : scale_param); } bc_init_num(&result TSRMLS_CC); @@ -510,14 +510,14 @@ PHP_FUNCTION(bccomp) size_t left_len, right_len; zend_long scale_param = 0; bc_num first, second; - int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS(); + 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) { return; } if (argc == 3) { - scale = (int) ((int)scale_param < 0) ? 0 : scale_param; + scale = (int) ((int)scale_param < 0 ? 0 : scale_param); } bc_init_num(&first TSRMLS_CC); diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c index 6e6f2a95c3..d49be40d35 100644 --- a/ext/bz2/bz2.c +++ b/ext/bz2/bz2.c @@ -138,22 +138,48 @@ struct php_bz2_stream_data_t { static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) { struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract; - size_t ret; + size_t ret = 0; - ret = BZ2_bzread(self->bz_file, buf, count); + do { + int just_read; + size_t remain = count - ret; + int to_read = (int)(remain <= INT_MAX ? remain : INT_MAX); - if (ret == 0) { - stream->eof = 1; - } + just_read = BZ2_bzread(self->bz_file, buf, to_read); + + if (just_read < 1) { + stream->eof = 0 == just_read; + break; + } + + ret += just_read; + } while (ret < count); return ret; } static size_t php_bz2iop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) { + size_t wrote = 0; struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract; - return BZ2_bzwrite(self->bz_file, (char*)buf, count); + + do { + int just_wrote; + size_t remain = count - wrote; + int to_write = (int)(remain <= INT_MAX ? remain : INT_MAX); + + just_wrote = BZ2_bzwrite(self->bz_file, (char*)buf, to_write); + + if (just_wrote < 1) { + break; + } + + wrote += just_wrote; + + } while (wrote < count); + + return wrote; } static int php_bz2iop_close(php_stream *stream, int close_handle TSRMLS_DC) @@ -262,7 +288,7 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, if (stream) { php_socket_t fd; if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **) &fd, REPORT_ERRORS)) { - bz_file = BZ2_bzdopen(fd, mode); + bz_file = BZ2_bzdopen((int)fd, mode); } } @@ -439,7 +465,7 @@ static PHP_FUNCTION(bzopen) RETURN_FALSE; } - bz = BZ2_bzdopen(fd, mode); + bz = BZ2_bzdopen((int)fd, mode); stream = php_stream_bz2open_from_BZFILE(bz, mode, stream); } else { @@ -554,7 +580,7 @@ static PHP_FUNCTION(bzdecompress) bzs.bzalloc = NULL; bzs.bzfree = NULL; - if (BZ2_bzDecompressInit(&bzs, 0, small) != BZ_OK) { + if (BZ2_bzDecompressInit(&bzs, 0, (int)small) != BZ_OK) { RETURN_FALSE; } diff --git a/ext/bz2/bz2.dsp b/ext/bz2/bz2.dsp deleted file mode 100644 index a858879396..0000000000 --- a/ext/bz2/bz2.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="bz2" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=bz2 - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "bz2.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "bz2.mak" CFG="bz2 - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "bz2 - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "bz2 - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "bz2 - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BZ2_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_BZ2" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_BZ2=1 /D "PHP_BZ2_EXPORTS" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 libbz2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_bz2.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\release"
-
-!ELSEIF "$(CFG)" == "bz2 - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BZ2_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_BZ2" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_BZ2=1 /D "PHP_BZ2_EXPORTS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php7ts_debug.lib libbz2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_bz2.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\release"
-
-!ENDIF
-
-# Begin Target
-
-# Name "bz2 - Win32 Release_TS"
-# Name "bz2 - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\bz2.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\bz2_filter.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_bz2.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/bz2/bz2_filter.c b/ext/bz2/bz2_filter.c index 1c1d6ccfb6..a2a21d765b 100644 --- a/ext/bz2/bz2_filter.c +++ b/ext/bz2/bz2_filter.c @@ -384,7 +384,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi 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)); } else { - blockSize100k = Z_LVAL(tmp); + blockSize100k = (int)Z_LVAL(tmp); } } @@ -398,7 +398,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi 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)); } else { - workFactor = Z_LVAL(tmp); + workFactor = (int)Z_LVAL(tmp); } } } diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index 2e34cfd03b..e1a9503dff 100644 --- a/ext/com_dotnet/com_com.c +++ b/ext/com_dotnet/com_com.c @@ -37,7 +37,7 @@ PHP_FUNCTION(com_create_instance) php_com_dotnet_object *obj; char *module_name, *typelib_name = NULL, *server_name = NULL; char *user_name = NULL, *domain_name = NULL, *password = NULL; - size_t module_name_len, typelib_name_len, server_name_len, + size_t module_name_len = 0, typelib_name_len = 0, server_name_len = 0, user_name_len, domain_name_len, password_len; OLECHAR *moniker; CLSID clsid; @@ -129,11 +129,11 @@ PHP_FUNCTION(com_create_instance) if (user_name) { authid.User = php_com_string_to_olestring(user_name, -1, obj->code_page TSRMLS_CC); - authid.UserLength = user_name_len; + authid.UserLength = (ULONG)user_name_len; if (password) { authid.Password = (OLECHAR*)password; - authid.PasswordLength = password_len; + authid.PasswordLength = (ULONG)password_len; } else { authid.Password = (OLECHAR*)""; authid.PasswordLength = 0; @@ -141,7 +141,7 @@ PHP_FUNCTION(com_create_instance) if (domain_name) { authid.Domain = (OLECHAR*)domain_name; - authid.DomainLength = domain_name_len; + authid.DomainLength = (ULONG)domain_name_len; } else { authid.Domain = (OLECHAR*)""; authid.DomainLength = 0; @@ -288,7 +288,7 @@ PHP_FUNCTION(com_get_active_object) { CLSID clsid; char *module_name; - int module_name_len; + size_t module_name_len; zend_long code_page = COMG(code_page); IUnknown *unk = NULL; IDispatch *obj = NULL; @@ -302,7 +302,7 @@ PHP_FUNCTION(com_get_active_object) return; } - module = php_com_string_to_olestring(module_name, module_name_len, code_page TSRMLS_CC); + module = php_com_string_to_olestring(module_name, module_name_len, (int)code_page TSRMLS_CC); res = CLSIDFromString(module, &clsid); @@ -320,7 +320,7 @@ PHP_FUNCTION(com_get_active_object) php_com_throw_exception(res, NULL TSRMLS_CC); } else if (obj) { /* we got our dispatchable object */ - php_com_wrap_dispatch(return_value, obj, code_page TSRMLS_CC); + php_com_wrap_dispatch(return_value, obj, (int)code_page TSRMLS_CC); } } } @@ -427,7 +427,7 @@ HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name, } if (obj->id_of_name_cache && NULL != (tmp = zend_hash_str_find(obj->id_of_name_cache, name, namelen))) { - *dispid = Z_LVAL_P(tmp); + *dispid = (DISPID)Z_LVAL_P(tmp); return S_OK; } @@ -464,7 +464,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, char *name, int namelen, +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) { DISPID dispid, altdispid; @@ -472,20 +472,19 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen, HRESULT hr; VARIANT *vargs = NULL, *byref_vals = NULL; int i, byref_count = 0, j; - zend_internal_function *f = (zend_internal_function*)EG(current_execute_data)->func; /* assumption: that the active function (f) is the function we generated for the engine */ - if (!f || f->arg_info == NULL) { - f = NULL; + if (!f) { + return FAILURE; } - hr = php_com_get_id_of_name(obj, name, namelen, &dispid TSRMLS_CC); + hr = php_com_get_id_of_name(obj, f->function_name->val, f->function_name->len, &dispid TSRMLS_CC); if (FAILED(hr)) { char *winerr = NULL; char *msg = NULL; winerr = php_win32_error_to_msg(hr); - spprintf(&msg, 0, "Unable to lookup `%s': %s", name, winerr); + spprintf(&msg, 0, "Unable to lookup `%s': %s", f->function_name->val, winerr); LocalFree(winerr); php_com_throw_exception(hr, msg TSRMLS_CC); efree(msg); @@ -497,7 +496,7 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen, vargs = (VARIANT*)safe_emalloc(sizeof(VARIANT), nargs, 0); } - if (f) { + if (f->arg_info) { for (i = 0; i < nargs; i++) { if (f->arg_info[nargs - i - 1].pass_by_reference) { byref_count++; @@ -552,30 +551,36 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen, /* release variants */ if (vargs) { - for (i = 0, j = 0; i < nargs; i++) { - /* if this was byref, update the zval */ - if (f && f->arg_info[nargs - i - 1].pass_by_reference) { - SEPARATE_ZVAL_IF_NOT_REF(&args[nargs - i - 1]); - - /* if the variant is pointing at the byref_vals, we need to map - * the pointee value as a zval; otherwise, the value is pointing - * into an existing PHP variant record */ - if (V_VT(&vargs[i]) & VT_BYREF) { - if (vargs[i].byref == &V_UINT(&byref_vals[j])) { - /* copy that value */ - php_com_zval_from_variant(&args[nargs - i - 1], &byref_vals[j], + if (f && f->arg_info) { + for (i = 0, j = 0; i < nargs; i++) { + /* if this was byref, update the zval */ + if (f->arg_info[nargs - i - 1].pass_by_reference) { + SEPARATE_ZVAL_IF_NOT_REF(&args[nargs - i - 1]); + + /* if the variant is pointing at the byref_vals, we need to map + * the pointee value as a zval; otherwise, the value is pointing + * into an existing PHP variant record */ + if (V_VT(&vargs[i]) & VT_BYREF) { + 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); + } + } 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); } - } 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); + VariantClear(&byref_vals[j]); + j++; } - VariantClear(&byref_vals[j]); - j++; - } - VariantClear(&vargs[i]); + VariantClear(&vargs[i]); + } + } else { + for (i = 0, j = 0; i < nargs; i++) { + VariantClear(&vargs[i]); + } } efree(vargs); } @@ -632,7 +637,7 @@ int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid, return SUCCEEDED(hr) ? SUCCESS : FAILURE; } -int php_com_do_invoke(php_com_dotnet_object *obj, char *name, int namelen, +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) { DISPID dispid; @@ -792,7 +797,7 @@ PHP_FUNCTION(com_message_pump) RETURN_FALSE; php_com_initialize(TSRMLS_C); - result = MsgWaitForMultipleObjects(0, NULL, FALSE, timeoutms, QS_ALLINPUT); + result = MsgWaitForMultipleObjects(0, NULL, FALSE, (DWORD)timeoutms, QS_ALLINPUT); if (result == WAIT_OBJECT_0) { while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c index f66119842e..7e15865950 100644 --- a/ext/com_dotnet/com_extension.c +++ b/ext/com_dotnet/com_extension.c @@ -454,6 +454,10 @@ PHP_MINIT_FUNCTION(com_dotnet) COM_ERR_CONST(DISP_E_BADINDEX); COM_ERR_CONST(MK_E_UNAVAILABLE); +#if SIZEOF_ZEND_LONG == 8 + COM_CONST(VT_UI8); + COM_CONST(VT_I8); +#endif return SUCCESS; } /* }}} */ diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c index 2774593e1c..8b721393fd 100644 --- a/ext/com_dotnet/com_handlers.c +++ b/ext/com_dotnet/com_handlers.c @@ -101,7 +101,7 @@ static zval *com_read_dimension(zval *object, zval *offset, int type, zval *rv T convert_to_long(offset); if (SafeArrayGetDim(V_ARRAY(&obj->v)) == 1) { - if (php_com_safearray_get_elem(&obj->v, &v, Z_LVAL_P(offset) TSRMLS_CC)) { + 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); VariantClear(&v); } @@ -145,7 +145,7 @@ static void com_write_dimension(zval *object, zval *offset, zval *value TSRMLS_D } convert_to_long(offset); - indices = Z_LVAL_P(offset); + indices = (LONG)Z_LVAL_P(offset); VariantInit(&v); php_com_variant_from_zval(&v, value, obj->code_page TSRMLS_CC); @@ -250,7 +250,7 @@ static PHP_FUNCTION(com_method_handler) zval *object = getThis(); Z_OBJ_HANDLER_P(object, call_method)( - ((zend_internal_function*)EG(current_execute_data)->func)->function_name, + ((zend_internal_function*)EX(func))->function_name, Z_OBJ_P(object), INTERNAL_FUNCTION_PARAM_PASSTHRU); } @@ -378,7 +378,7 @@ static int com_call_method(zend_string *method, zend_object *object, INTERNAL_FU VariantInit(&v); - if (SUCCESS == php_com_do_invoke_byref(obj, method->val, method->len, DISPATCH_METHOD|DISPATCH_PROPERTYGET, &v, nargs, args TSRMLS_CC)) { + 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); ret = SUCCESS; VariantClear(&v); @@ -423,14 +423,7 @@ static union _zend_function *com_constructor_get(zend_object *object TSRMLS_DC) } } -static zend_class_entry *com_class_entry_get(const zend_object *object TSRMLS_DC) -{ - php_com_dotnet_object *obj = (php_com_dotnet_object *)object; - - return obj->ce; -} - -static zend_string* com_class_name_get(const zend_object *object, int parent TSRMLS_DC) +static zend_string* com_class_name_get(const zend_object *object TSRMLS_DC) { php_com_dotnet_object *obj = (php_com_dotnet_object *)object; @@ -564,7 +557,6 @@ zend_object_handlers php_com_object_handlers = { com_method_get, com_call_method, com_constructor_get, - com_class_entry_get, com_class_name_get, com_objects_compare, com_object_cast, diff --git a/ext/com_dotnet/com_misc.c b/ext/com_dotnet/com_misc.c index 084a720ea1..f0b21ff014 100644 --- a/ext/com_dotnet/com_misc.c +++ b/ext/com_dotnet/com_misc.c @@ -36,7 +36,11 @@ void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC) message = php_win32_error_to_msg(code); free_msg = 1; } +#if SIZEOF_ZEND_LONG == 8 + zend_throw_exception(php_com_exception_class_entry, message, (zend_long)(uint32_t)code TSRMLS_CC); +#else zend_throw_exception(php_com_exception_class_entry, message, (zend_long)code TSRMLS_CC); +#endif if (free_msg) { LocalFree(message); } diff --git a/ext/com_dotnet/com_olechar.c b/ext/com_dotnet/com_olechar.c index 51cc7e8f1d..2e0b558288 100644 --- a/ext/com_dotnet/com_olechar.c +++ b/ext/com_dotnet/com_olechar.c @@ -49,7 +49,7 @@ PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, size_t str /* XXX if that's a real multibyte string, olestring is obviously allocated excessively. This should be fixed by reallocating the olestring, but as emalloc is used, that doesn't matter much. */ - ok = MultiByteToWideChar(codepage, flags, string, string_len, olestring, string_len); + ok = MultiByteToWideChar(codepage, flags, string, (int)string_len, olestring, (int)string_len); if (ok > 0 && ok < string_len) { olestring[ok] = '\0'; } diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c index eb80e760c8..dbe8b45300 100644 --- a/ext/com_dotnet/com_persist.c +++ b/ext/com_dotnet/com_persist.c @@ -105,10 +105,10 @@ static ULONG STDMETHODCALLTYPE stm_release(IStream *This) static HRESULT STDMETHODCALLTYPE stm_read(IStream *This, void *pv, ULONG cb, ULONG *pcbRead) { - int nread; + ULONG nread; FETCH_STM(); - nread = php_stream_read(stm->stream, pv, cb); + nread = (ULONG)php_stream_read(stm->stream, pv, cb); if (pcbRead) { *pcbRead = nread > 0 ? nread : 0; @@ -121,10 +121,10 @@ static HRESULT STDMETHODCALLTYPE stm_read(IStream *This, void *pv, ULONG cb, ULO static HRESULT STDMETHODCALLTYPE stm_write(IStream *This, void const *pv, ULONG cb, ULONG *pcbWritten) { - int nwrote; + ULONG nwrote; FETCH_STM(); - nwrote = php_stream_write(stm->stream, pv, cb); + nwrote = (ULONG)php_stream_write(stm->stream, pv, cb); if (pcbWritten) { *pcbWritten = nwrote > 0 ? nwrote : 0; @@ -466,7 +466,7 @@ CPH_METHOD(LoadFromFile) olefilename = php_com_string_to_olestring(fullpath, strlen(fullpath), helper->codepage TSRMLS_CC); efree(fullpath); - res = IPersistFile_Load(helper->ipf, olefilename, flags); + res = IPersistFile_Load(helper->ipf, olefilename, (DWORD)flags); efree(olefilename); if (FAILED(res)) { diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c index 881ebfbaea..1d187a77bf 100644 --- a/ext/com_dotnet/com_saproxy.c +++ b/ext/com_dotnet/com_saproxy.c @@ -167,11 +167,11 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type, zval * /* copy indices from proxy */ for (i = 0; i < dims; i++) { convert_to_long(&proxy->indices[i]); - indices[i] = Z_LVAL(proxy->indices[i]); + indices[i] = (LONG)Z_LVAL(proxy->indices[i]); } /* add user-supplied index */ - indices[dims-1] = Z_LVAL_P(offset); + indices[dims-1] = (LONG)Z_LVAL_P(offset); /* now fetch the value */ if (FAILED(SafeArrayGetVartype(sa, &vt)) || vt == VT_EMPTY) { @@ -241,12 +241,12 @@ static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRM /* copy indices from proxy */ for (i = 0; i < dims; i++) { convert_to_long(&proxy->indices[i]); - indices[i] = Z_LVAL(proxy->indices[i]); + indices[i] = (LONG)Z_LVAL(proxy->indices[i]); } /* add user-supplied index */ convert_to_long(offset); - indices[dims-1] = Z_LVAL_P(offset); + indices[dims-1] = (LONG)Z_LVAL_P(offset); if (FAILED(SafeArrayGetVartype(V_ARRAY(&proxy->obj->v), &vt)) || vt == VT_EMPTY) { vt = V_VT(&proxy->obj->v) & ~VT_ARRAY; @@ -333,12 +333,7 @@ static union _zend_function *saproxy_constructor_get(zend_object *object TSRMLS_ return NULL; } -static zend_class_entry *saproxy_class_entry_get(const zend_object *object TSRMLS_DC) -{ - return php_com_saproxy_class_entry; -} - -static zend_string* saproxy_class_name_get(const zend_object *object, int parent TSRMLS_DC) +static zend_string* saproxy_class_name_get(const zend_object *object TSRMLS_DC) { return zend_string_copy(php_com_saproxy_class_entry->name); } @@ -420,7 +415,6 @@ zend_object_handlers php_com_saproxy_handlers = { saproxy_method_get, saproxy_call_method, saproxy_constructor_get, - saproxy_class_entry_get, saproxy_class_name_get, saproxy_objects_compare, saproxy_object_cast, @@ -561,7 +555,7 @@ zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *objec I->indices = safe_emalloc(proxy->dimensions + 1, sizeof(LONG), 0); for (i = 0; i < proxy->dimensions; i++) { convert_to_long(&proxy->indices[i]); - I->indices[i] = Z_LVAL(proxy->indices[i]); + I->indices[i] = (LONG)Z_LVAL(proxy->indices[i]); } SafeArrayGetLBound(V_ARRAY(&proxy->obj->v), proxy->dimensions, &I->imin); diff --git a/ext/com_dotnet/com_typeinfo.c b/ext/com_dotnet/com_typeinfo.c index 33b1c65c9c..17b69d2460 100644 --- a/ext/com_dotnet/com_typeinfo.c +++ b/ext/com_dotnet/com_typeinfo.c @@ -116,7 +116,7 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codep continue; } /* get the default value for this key and compare */ - libnamelen = strlen(search_string)+1; + libnamelen = (DWORD)strlen(search_string)+1; if (ERROR_SUCCESS == RegQueryValue(hsubkey, version, libname, &libnamelen)) { if (0 == stricmp(libname, search_string)) { char *str = NULL; @@ -234,7 +234,7 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string, { ITypeLib *TL; char *name_dup; - int l; + size_t l; l = strlen(search_string); diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c index dbd5529f6d..6a81eed102 100644 --- a/ext/com_dotnet/com_variant.c +++ b/ext/com_dotnet/com_variant.c @@ -62,7 +62,7 @@ static void safe_array_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC) /* allocate the structure */ bound.lLbound = 0; - bound.cElements = intindex + 1; + bound.cElements = (ULONG)(intindex + 1); sa = SafeArrayCreate(VT_VARIANT, 1, &bound); /* get a lock on the array itself */ @@ -146,8 +146,13 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep break; case IS_LONG: +#if SIZEOF_ZEND_LONG == 4 V_VT(v) = VT_I4; V_I4(v) = Z_LVAL_P(z); +#else + V_VT(v) = VT_I8; + V_I8(v) = Z_LVAL_P(z); +#endif break; case IS_DOUBLE: @@ -159,9 +164,9 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep V_VT(v) = VT_BSTR; olestring = php_com_string_to_olestring(Z_STRVAL_P(z), Z_STRLEN_P(z), codepage TSRMLS_CC); if (CP_UTF8 == codepage) { - V_BSTR(v) = SysAllocStringByteLen((char*)olestring, wcslen(olestring) * sizeof(OLECHAR)); + V_BSTR(v) = SysAllocStringByteLen((char*)olestring, (UINT)(wcslen(olestring) * sizeof(OLECHAR))); } else { - V_BSTR(v) = SysAllocStringByteLen((char*)olestring, Z_STRLEN_P(z) * sizeof(OLECHAR)); + V_BSTR(v) = SysAllocStringByteLen((char*)olestring, (UINT)(Z_STRLEN_P(z) * sizeof(OLECHAR))); } efree(olestring); break; @@ -199,11 +204,19 @@ PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepa ZVAL_LONG(z, (zend_long)V_I2(v)); break; case VT_UI4: /* TODO: promote to double if large? */ - ZVAL_LONG(z, (zend_long)V_UI4(v)); + ZVAL_LONG(z, (long)V_UI4(v)); break; case VT_I4: - ZVAL_LONG(z, (zend_long)V_I4(v)); + ZVAL_LONG(z, (long)V_I4(v)); + break; +#if SIZEOF_ZEND_LONG == 8 + case VT_UI8: + ZVAL_LONG(z, (zend_long)V_UI8(v)); break; + case VT_I8: + ZVAL_LONG(z, (zend_long)V_I8(v)); + break; +#endif case VT_INT: ZVAL_LONG(z, V_INT(v)); break; @@ -328,7 +341,23 @@ PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSR V_I4(dstvar) = V_I4(srcvar); } break; +#if SIZEOF_ZEND_LONG == 8 + case VT_UI8: + if (V_VT(dstvar) & VT_BYREF) { + *V_UI8REF(dstvar) = V_UI8(srcvar); + } else { + V_UI8(dstvar) = V_UI8(srcvar); + } + break; + case VT_I8: + if (V_VT(dstvar) & VT_BYREF) { + *V_I8REF(dstvar) = V_I8(srcvar); + } else { + V_I8(dstvar) = V_I8(srcvar); + } + break; +#endif case VT_INT: if (V_VT(dstvar) & VT_BYREF) { *V_INTREF(dstvar) = V_INT(srcvar); @@ -428,7 +457,7 @@ PHP_FUNCTION(com_variant_create_instance) php_com_initialize(TSRMLS_C); if (ZEND_NUM_ARGS() == 3) { - obj->code_page = codepage; + obj->code_page = (int)codepage; } if (zvalue) { @@ -849,7 +878,7 @@ PHP_FUNCTION(variant_round) return; } - if (SUCCEEDED(VarRound(vleft, decimals, &vres))) { + if (SUCCEEDED(VarRound(vleft, (int)decimals, &vres))) { php_com_wrap_variant(return_value, &vres, codepage TSRMLS_CC); } @@ -909,7 +938,7 @@ PHP_FUNCTION(variant_cmp) return; } - ZVAL_LONG(return_value, VarCmp(vleft, vright, lcid, flags)); + ZVAL_LONG(return_value, VarCmp(vleft, vright, (LCID)lcid, (ULONG)flags)); VariantClear(&left_val); VariantClear(&right_val); diff --git a/ext/com_dotnet/com_wrapper.c b/ext/com_dotnet/com_wrapper.c index 6112dfb4bf..f7dd7fd463 100644 --- a/ext/com_dotnet/com_wrapper.c +++ b/ext/com_dotnet/com_wrapper.c @@ -186,7 +186,7 @@ static HRESULT STDMETHODCALLTYPE disp_getidsofnames( ret = DISP_E_UNKNOWNNAME; rgDispId[i] = 0; } else { - rgDispId[i] = Z_LVAL_P(tmp); + rgDispId[i] = (DISPID)Z_LVAL_P(tmp); } efree(name); @@ -231,7 +231,7 @@ static HRESULT STDMETHODCALLTYPE disp_getdispid( /* Lookup the name in the hash */ if ((tmp = zend_hash_str_find(disp->name_to_dispid, name, namelen)) != NULL) { trace("found it\n"); - *pid = Z_LVAL_P(tmp); + *pid = (DISPID)Z_LVAL_P(tmp); ret = S_OK; } diff --git a/ext/com_dotnet/php_com_dotnet_internal.h b/ext/com_dotnet/php_com_dotnet_internal.h index c7e3a5ad78..e06f50c7d6 100644 --- a/ext/com_dotnet/php_com_dotnet_internal.h +++ b/ext/com_dotnet/php_com_dotnet_internal.h @@ -37,8 +37,9 @@ typedef struct _php_com_dotnet_object { VARIANT v; int modified; + int code_page; + ITypeInfo *typeinfo; - zend_long code_page; zend_class_entry *ce; @@ -107,9 +108,9 @@ HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name, size_t namelen, DISPID *dispid TSRMLS_DC); 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); -int php_com_do_invoke(php_com_dotnet_object *obj, char *name, int namelen, +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); -int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen, +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); /* com_wrapper.c */ diff --git a/ext/com_dotnet/tests/bug33386.phpt b/ext/com_dotnet/tests/bug33386.phpt index e57f1274c1..e7dcd28489 100644 --- a/ext/com_dotnet/tests/bug33386.phpt +++ b/ext/com_dotnet/tests/bug33386.phpt @@ -2,7 +2,9 @@ Bug #33386 (ScriptControl only sees last function of class) --SKIPIF-- <?php -if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; ?> +if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; +if (4 != PHP_INT_SIZE) print "skip MSScriptControl isn't available under x64"; +?> --FILE-- <?php error_reporting(E_ALL); diff --git a/ext/com_dotnet/tests/variants.phpt b/ext/com_dotnet/tests/variants.phpt index 0fd27bee5e..6c50beb738 100644 --- a/ext/com_dotnet/tests/variants.phpt +++ b/ext/com_dotnet/tests/variants.phpt @@ -2,7 +2,8 @@ COM: General variant tests --SKIPIF-- <?php # vim:ft=php -if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; ?> +if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; +if (4 != PHP_INT_SIZE) print "skip x86 only"; ?> --FILE-- <?php // $Id$ error_reporting(E_ALL); diff --git a/ext/com_dotnet/tests/variants_x64.phpt b/ext/com_dotnet/tests/variants_x64.phpt new file mode 100644 index 0000000000..1c75a9da79 --- /dev/null +++ b/ext/com_dotnet/tests/variants_x64.phpt @@ -0,0 +1,638 @@ +--TEST-- +COM: General variant tests +--SKIPIF-- +<?php # vim:ft=php +if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; +if (8 != PHP_INT_SIZE) print "skip x64 only"; ?> +--FILE-- +<?php // $Id$ +error_reporting(E_ALL); + +$v = new VARIANT(); +if (VT_EMPTY != variant_get_type($v)) { + echo "VT_EMPTY: bork\n"; +} + +$values = array(VT_I8 => 42, VT_R8 => 3.5, VT_BSTR => "hello", VT_BOOL => false); +$binary_ops = array('add', 'cat', 'sub', 'mul', 'and', 'div', + 'eqv', 'idiv', 'imp', 'mod', 'or', 'pow', 'xor'); + +foreach ($values as $t => $val) { + $v = new VARIANT($val); + if ($t != variant_get_type($v)) { + printf("Bork: [%d] %d: %s\n", $t, variant_get_type($v), $val); + print $v . "\n"; + } + $results = array(); + + foreach ($values as $op2) { + echo "--\n"; + foreach ($binary_ops as $op) { + try { + echo "$op: " . call_user_func('variant_' . $op, $v, $op2) . "\n"; + } catch (com_exception $e) { + echo "$op:\n"; + echo "\tvariant_$op($v, $op2)\n"; + echo "\texception " . $e->getMessage(); + printf("\tcode %08x\n\n", $e->getCode()); + } + } + } +} + +echo "OK!"; +?> +--EXPECT-- +-- +add: 84 +cat: 4242 +sub: 0 +mul: 1764 +and: 42 +div: 1 +eqv: -1 +idiv: 1 +imp: -1 +mod: 0 +or: 42 +pow: 1.50130937545297E+68 +xor: 0 +-- +add: 45.5 +cat: 423.5 +sub: 38.5 +mul: 147 +and: 0 +div: 12 +eqv: -47 +idiv: 10 +imp: -43 +mod: 2 +or: 46 +pow: 480145.116863642 +xor: 46 +-- +add: + variant_add(42, hello) + exception Type mismatch. + code 80020005 + +cat: 42hello +sub: + variant_sub(42, hello) + exception Type mismatch. + code 80020005 + +mul: + variant_mul(42, hello) + exception Type mismatch. + code 80020005 + +and: + variant_and(42, hello) + exception Type mismatch. + code 80020005 + +div: + variant_div(42, hello) + exception Type mismatch. + code 80020005 + +eqv: + variant_eqv(42, hello) + exception Type mismatch. + code 80020005 + +idiv: + variant_idiv(42, hello) + exception Type mismatch. + code 80020005 + +imp: + variant_imp(42, hello) + exception Type mismatch. + code 80020005 + +mod: + variant_mod(42, hello) + exception Type mismatch. + code 80020005 + +or: + variant_or(42, hello) + exception Type mismatch. + code 80020005 + +pow: + variant_pow(42, hello) + exception Type mismatch. + code 80020005 + +xor: + variant_xor(42, hello) + exception Type mismatch. + code 80020005 + +-- +add: 42 +cat: 42False +sub: 42 +mul: 0 +and: 0 +div: + variant_div(42, ) + exception Division by zero. + code 80020012 + +eqv: -43 +idiv: + variant_idiv(42, ) + exception Division by zero. + code 80020012 + +imp: -43 +mod: + variant_mod(42, ) + exception Division by zero. + code 80020012 + +or: 42 +pow: 1 +xor: 42 +-- +add: 45.5 +cat: 3.542 +sub: -38.5 +mul: 147 +and: 0 +div: 8.33333333333333E-02 +eqv: -47 +idiv: 0 +imp: -5 +mod: 4 +or: 46 +pow: 7.09345573078604E+22 +xor: 46 +-- +add: 7 +cat: 3.53.5 +sub: 0 +mul: 12.25 +and: 4 +div: 1 +eqv: -1 +idiv: 1 +imp: -1 +mod: 0 +or: 4 +pow: 80.2117802289664 +xor: 0 +-- +add: + variant_add(3.5, hello) + exception Type mismatch. + code 80020005 + +cat: 3.5hello +sub: + variant_sub(3.5, hello) + exception Type mismatch. + code 80020005 + +mul: + variant_mul(3.5, hello) + exception Type mismatch. + code 80020005 + +and: + variant_and(3.5, hello) + exception Type mismatch. + code 80020005 + +div: + variant_div(3.5, hello) + exception Type mismatch. + code 80020005 + +eqv: + variant_eqv(3.5, hello) + exception Type mismatch. + code 80020005 + +idiv: + variant_idiv(3.5, hello) + exception Type mismatch. + code 80020005 + +imp: + variant_imp(3.5, hello) + exception Type mismatch. + code 80020005 + +mod: + variant_mod(3.5, hello) + exception Type mismatch. + code 80020005 + +or: + variant_or(3.5, hello) + exception Type mismatch. + code 80020005 + +pow: + variant_pow(3.5, hello) + exception Type mismatch. + code 80020005 + +xor: + variant_xor(3.5, hello) + exception Type mismatch. + code 80020005 + +-- +add: 3.5 +cat: 3.5False +sub: 3.5 +mul: 0 +and: 0 +div: + variant_div(3.5, ) + exception Division by zero. + code 80020012 + +eqv: -5 +idiv: + variant_idiv(3.5, ) + exception Division by zero. + code 80020012 + +imp: -5 +mod: + variant_mod(3.5, ) + exception Division by zero. + code 80020012 + +or: 4 +pow: 1 +xor: 4 +-- +add: + variant_add(hello, 42) + exception Type mismatch. + code 80020005 + +cat: hello42 +sub: + variant_sub(hello, 42) + exception Type mismatch. + code 80020005 + +mul: + variant_mul(hello, 42) + exception Type mismatch. + code 80020005 + +and: + variant_and(hello, 42) + exception Type mismatch. + code 80020005 + +div: + variant_div(hello, 42) + exception Type mismatch. + code 80020005 + +eqv: + variant_eqv(hello, 42) + exception Type mismatch. + code 80020005 + +idiv: + variant_idiv(hello, 42) + exception Type mismatch. + code 80020005 + +imp: + variant_imp(hello, 42) + exception Type mismatch. + code 80020005 + +mod: + variant_mod(hello, 42) + exception Type mismatch. + code 80020005 + +or: + variant_or(hello, 42) + exception Type mismatch. + code 80020005 + +pow: + variant_pow(hello, 42) + exception Type mismatch. + code 80020005 + +xor: + variant_xor(hello, 42) + exception Type mismatch. + code 80020005 + +-- +add: + variant_add(hello, 3.5) + exception Type mismatch. + code 80020005 + +cat: hello3.5 +sub: + variant_sub(hello, 3.5) + exception Type mismatch. + code 80020005 + +mul: + variant_mul(hello, 3.5) + exception Type mismatch. + code 80020005 + +and: + variant_and(hello, 3.5) + exception Type mismatch. + code 80020005 + +div: + variant_div(hello, 3.5) + exception Type mismatch. + code 80020005 + +eqv: + variant_eqv(hello, 3.5) + exception Type mismatch. + code 80020005 + +idiv: + variant_idiv(hello, 3.5) + exception Type mismatch. + code 80020005 + +imp: + variant_imp(hello, 3.5) + exception Type mismatch. + code 80020005 + +mod: + variant_mod(hello, 3.5) + exception Type mismatch. + code 80020005 + +or: + variant_or(hello, 3.5) + exception Type mismatch. + code 80020005 + +pow: + variant_pow(hello, 3.5) + exception Type mismatch. + code 80020005 + +xor: + variant_xor(hello, 3.5) + exception Type mismatch. + code 80020005 + +-- +add: hellohello +cat: hellohello +sub: + variant_sub(hello, hello) + exception Type mismatch. + code 80020005 + +mul: + variant_mul(hello, hello) + exception Type mismatch. + code 80020005 + +and: + variant_and(hello, hello) + exception Type mismatch. + code 80020005 + +div: + variant_div(hello, hello) + exception Type mismatch. + code 80020005 + +eqv: + variant_eqv(hello, hello) + exception Type mismatch. + code 80020005 + +idiv: + variant_idiv(hello, hello) + exception Type mismatch. + code 80020005 + +imp: + variant_imp(hello, hello) + exception Type mismatch. + code 80020005 + +mod: + variant_mod(hello, hello) + exception Type mismatch. + code 80020005 + +or: + variant_or(hello, hello) + exception Type mismatch. + code 80020005 + +pow: + variant_pow(hello, hello) + exception Type mismatch. + code 80020005 + +xor: + variant_xor(hello, hello) + exception Type mismatch. + code 80020005 + +-- +add: + variant_add(hello, ) + exception Type mismatch. + code 80020005 + +cat: helloFalse +sub: + variant_sub(hello, ) + exception Type mismatch. + code 80020005 + +mul: + variant_mul(hello, ) + exception Type mismatch. + code 80020005 + +and: + variant_and(hello, ) + exception Type mismatch. + code 80020005 + +div: + variant_div(hello, ) + exception Type mismatch. + code 80020005 + +eqv: + variant_eqv(hello, ) + exception Type mismatch. + code 80020005 + +idiv: + variant_idiv(hello, ) + exception Type mismatch. + code 80020005 + +imp: + variant_imp(hello, ) + exception Type mismatch. + code 80020005 + +mod: + variant_mod(hello, ) + exception Type mismatch. + code 80020005 + +or: + variant_or(hello, ) + exception Type mismatch. + code 80020005 + +pow: + variant_pow(hello, ) + exception Type mismatch. + code 80020005 + +xor: + variant_xor(hello, ) + exception Type mismatch. + code 80020005 + +-- +add: 42 +cat: False42 +sub: -42 +mul: 0 +and: 0 +div: 0 +eqv: -43 +idiv: 0 +imp: -1 +mod: 0 +or: 42 +pow: 0 +xor: 42 +-- +add: 3.5 +cat: False3.5 +sub: -3.5 +mul: 0 +and: 0 +div: 0 +eqv: -5 +idiv: 0 +imp: -1 +mod: 0 +or: 4 +pow: 0 +xor: 4 +-- +add: + variant_add(0, hello) + exception Type mismatch. + code 80020005 + +cat: Falsehello +sub: + variant_sub(0, hello) + exception Type mismatch. + code 80020005 + +mul: + variant_mul(0, hello) + exception Type mismatch. + code 80020005 + +and: + variant_and(0, hello) + exception Type mismatch. + code 80020005 + +div: + variant_div(0, hello) + exception Type mismatch. + code 80020005 + +eqv: + variant_eqv(0, hello) + exception Type mismatch. + code 80020005 + +idiv: + variant_idiv(0, hello) + exception Type mismatch. + code 80020005 + +imp: + variant_imp(0, hello) + exception Type mismatch. + code 80020005 + +mod: + variant_mod(0, hello) + exception Type mismatch. + code 80020005 + +or: + variant_or(0, hello) + exception Type mismatch. + code 80020005 + +pow: + variant_pow(0, hello) + exception Type mismatch. + code 80020005 + +xor: + variant_xor(0, hello) + exception Type mismatch. + code 80020005 + +-- +add: 0 +cat: FalseFalse +sub: 0 +mul: 0 +and: 0 +div: + variant_div(0, ) + exception Out of present range. + code 8002000a + +eqv: -1 +idiv: + variant_idiv(0, ) + exception Division by zero. + code 80020012 + +imp: -1 +mod: + variant_mod(0, ) + exception Division by zero. + code 80020012 + +or: 0 +pow: 1 +xor: 0 +OK! diff --git a/ext/ctype/ctype.c b/ext/ctype/ctype.c index 41d5559c67..b03afe05f0 100644 --- a/ext/ctype/ctype.c +++ b/ext/ctype/ctype.c @@ -148,9 +148,9 @@ static PHP_MINFO_FUNCTION(ctype) return; \ if (Z_TYPE_P(c) == IS_LONG) { \ if (Z_LVAL_P(c) <= 255 && Z_LVAL_P(c) >= 0) { \ - RETURN_BOOL(iswhat(Z_LVAL_P(c))); \ + RETURN_BOOL(iswhat((int)Z_LVAL_P(c))); \ } else if (Z_LVAL_P(c) >= -128 && Z_LVAL_P(c) < 0) { \ - RETURN_BOOL(iswhat(Z_LVAL_P(c) + 256)); \ + RETURN_BOOL(iswhat((int)Z_LVAL_P(c) + 256)); \ } \ tmp = *c; \ zval_copy_ctor(&tmp); \ diff --git a/ext/ctype/ctype.dsp b/ext/ctype/ctype.dsp deleted file mode 100644 index d9bde43178..0000000000 --- a/ext/ctype/ctype.dsp +++ /dev/null @@ -1,107 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ctype" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=ctype - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "ctype.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "ctype.mak" CFG="ctype - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "ctype - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "ctype - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "ctype - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CTYPE_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "PHP_EXPORTS" /D "COMPILE_DL_CTYPE" /D ZTS=1 /D HAVE_CTYPE=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php7ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ctype.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "ctype - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CTYPE_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_CTYPE" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CTYPE=1 /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php7ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_ctype.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "ctype - Win32 Release_TS"
-# Name "ctype - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\ctype.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_ctype.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/curl/curl.dsp b/ext/curl/curl.dsp deleted file mode 100644 index ae3257619c..0000000000 --- a/ext/curl/curl.dsp +++ /dev/null @@ -1,190 +0,0 @@ -# Microsoft Developer Studio Project File - Name="curl" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=curl - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "curl.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "curl.mak" CFG="curl - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "curl - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "curl - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "curl - Win32 Debug_TS_SSL" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "curl - Win32 Release_TS_SSL" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "curl - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CURL" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib /nologo /dll /machine:I386
-# ADD LINK32 php7ts.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /machine:I386 /nodefaultlib:"MSVCRT" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\curl\lib"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF "$(CFG)" == "curl - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CURL" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib /nologo /dll /machine:I386
-# ADD LINK32 php7ts_debug.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib wsock32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"MSVCRTD" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\curl\lib"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF "$(CFG)" == "curl - Win32 Debug_TS_SSL"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "curl___Win32_Debug_TS_SSL"
-# PROP BASE Intermediate_Dir "curl___Win32_Debug_TS_SSL"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS_SSL"
-# PROP Intermediate_Dir "Debug_TS_SSL"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_CURL=1 /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php7ts_debug.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"msvcrtd.lib" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS"
-# SUBTRACT BASE LINK32 /pdb:none
-# ADD LINK32 php7ts_debug.lib libcurl.lib ssleay32.lib libeay32.lib msvcrt.lib ws2_32.lib winmm.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"MSVCRTD" /out:"..\..\Debug_TS/php_curl.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\curl\lib"
-# SUBTRACT LINK32 /pdb:none /nodefaultlib
-
-!ELSEIF "$(CFG)" == "curl - Win32 Release_TS_SSL"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "curl___Win32_Release_TS_SSL"
-# PROP BASE Intermediate_Dir "curl___Win32_Release_TS_SSL"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS_SSL"
-# PROP Intermediate_Dir "Release_TS_SSL"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\php_build\curl\include" /D "WIN32" /D "CURL_EXPORTS" /D "COMPILE_DL_CURL" /D ZTS=1 /D HAVE_CURL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php7ts.lib libcurl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-# SUBTRACT BASE LINK32 /pdb:none
-# ADD LINK32 php7ts.lib libcurl.lib ssleay32.lib libeay32.lib msvcrt.lib ws2_32.lib winmm.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /machine:I386 /nodefaultlib:"MSVCRT" /out:"..\..\Release_TS/php_curl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\curl\lib"
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF
-
-# Begin Target
-
-# Name "curl - Win32 Release_TS"
-# Name "curl - Win32 Debug_TS"
-# Name "curl - Win32 Debug_TS_SSL"
-# Name "curl - Win32 Release_TS_SSL"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\interface.c
-# End Source File
-
-# Begin Source File
-SOURCE=.\multi.c
-# End Source File
-
-# Begin Source File
-SOURCE=.\share.c
-# End Source File
-
-# Begin Source File
-SOURCE=.\streams.c
-# End Source File
-
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_curl.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/curl/interface.c b/ext/curl/interface.c index d7cacf54f9..af1ccdd4cf 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -170,6 +170,11 @@ static int php_curl_option_str(php_curl *ch, zend_long option, const char *str, { CURLcode error = CURLE_OK; + if (strlen(str) != len) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Curl option contains invalid characters (\\0)"); + return FAILURE; + } + #if LIBCURL_VERSION_NUM >= 0x071100 if (make_copy) { #endif @@ -557,6 +562,12 @@ PHP_MINFO_FUNCTION(curl) #if LIBCURL_VERSION_NUM >= 0x071504 /* 7.21.4 */ {"TLS-SRP", CURL_VERSION_TLSAUTH_SRP}, #endif +#if LIBCURL_VERSION_NUM >= 0x072100 /* 7.33.0 */ + {"HTTP2", CURL_VERSION_HTTP2}, +#endif +#if LIBCURL_VERSION_NUM >= 0x072600 /* 7.38.0 */ + {"GSSAPI", CURL_VERSION_GSSAPI}, +#endif {NULL, 0} }; @@ -1190,6 +1201,12 @@ PHP_MINIT_FUNCTION(curl) REGISTER_CURL_CONSTANT(CURLSSLOPT_ALLOW_BEAST); #endif +#if LIBCURL_VERSION_NUM >= 0x072200 /* Available since 7.34.0 */ + REGISTER_CURL_CONSTANT(CURL_SSLVERSION_TLSv1_0); + REGISTER_CURL_CONSTANT(CURL_SSLVERSION_TLSv1_1); + REGISTER_CURL_CONSTANT(CURL_SSLVERSION_TLSv1_2); +#endif + #if CURLOPT_FTPASCII != 0 REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII); #endif diff --git a/ext/curl/tests/bug68089.phpt b/ext/curl/tests/bug68089.phpt new file mode 100644 index 0000000000..3bd5889709 --- /dev/null +++ b/ext/curl/tests/bug68089.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #68089 (NULL byte injection - cURL lib) +--SKIPIF-- +<?php +include 'skipif.inc'; + +?> +--FILE-- +<?php +$url = "file:///etc/passwd\0http://google.com"; +$ch = curl_init(); +var_dump(curl_setopt($ch, CURLOPT_URL, $url)); +?> +Done +--EXPECTF-- +Warning: curl_setopt(): Curl option contains invalid characters (\0) in %s/bug68089.php on line 4 +bool(false) +Done diff --git a/ext/curl/tests/check_win_config.phpt b/ext/curl/tests/check_win_config.phpt index d82fe6f41a..3d13638f90 100644 --- a/ext/curl/tests/check_win_config.phpt +++ b/ext/curl/tests/check_win_config.phpt @@ -40,6 +40,8 @@ SPNEGO => Yes SSL => Yes
SSPI => Yes
TLS-SRP => No
+HTTP2 => No
+GSSAPI => No
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp
Host => %s-pc-win32
SSL Version => OpenSSL/%s
diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c index 2a615559f6..f9872a5ce3 100644 --- a/ext/date/lib/parse_date.c +++ b/ext/date/lib/parse_date.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Tue Aug 26 10:40:19 2014 */ +/* Generated by re2c 0.13.5 on Thu Oct 30 18:16:16 2014 */ #line 1 "ext/date/lib/parse_date.re" /* +----------------------------------------------------------------------+ @@ -24712,7 +24712,7 @@ yy1537: #define YYMAXFILL 31 -timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper) +timelib_time* timelib_strtotime(char *s, size_t len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper) { Scanner in; int t; @@ -24823,7 +24823,7 @@ static void timelib_time_reset_unset_fields(timelib_time *time) if (time->f == TIMELIB_UNSET ) time->f = 0.0; } -timelib_time *timelib_parse_from_format(char *format, char *string, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper) +timelib_time *timelib_parse_from_format(char *format, char *string, size_t len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper) { char *fptr = format; char *ptr = string; diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re index cb5df16251..7c4d143368 100644 --- a/ext/date/lib/parse_date.re +++ b/ext/date/lib/parse_date.re @@ -1721,7 +1721,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of /*!max:re2c */ -timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper) +timelib_time* timelib_strtotime(char *s, size_t len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper) { Scanner in; int t; @@ -1832,7 +1832,7 @@ static void timelib_time_reset_unset_fields(timelib_time *time) if (time->f == TIMELIB_UNSET ) time->f = 0.0; } -timelib_time *timelib_parse_from_format(char *format, char *string, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper) +timelib_time *timelib_parse_from_format(char *format, char *string, size_t len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper) { char *fptr = format; char *ptr = string; diff --git a/ext/date/lib/parse_iso_intervals.c b/ext/date/lib/parse_iso_intervals.c index 3b7580f9d1..ffa33b0698 100644 --- a/ext/date/lib/parse_iso_intervals.c +++ b/ext/date/lib/parse_iso_intervals.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Tue Aug 26 10:39:58 2014 */ +/* Generated by re2c 0.13.5 on Thu Oct 30 18:20:16 2014 */ #line 1 "ext/date/lib/parse_iso_intervals.re" /* +----------------------------------------------------------------------+ @@ -1004,7 +1004,7 @@ yy100: #define YYMAXFILL 20 -void timelib_strtointerval(char *s, int len, +void timelib_strtointerval(char *s, size_t len, timelib_time **begin, timelib_time **end, timelib_rel_time **period, int *recurrences, struct timelib_error_container **errors) diff --git a/ext/date/lib/parse_iso_intervals.re b/ext/date/lib/parse_iso_intervals.re index 097488ec57..b400522584 100644 --- a/ext/date/lib/parse_iso_intervals.re +++ b/ext/date/lib/parse_iso_intervals.re @@ -398,7 +398,7 @@ isoweek = year4 "-"? "W" weekofyear; /*!max:re2c */ -void timelib_strtointerval(char *s, int len, +void timelib_strtointerval(char *s, size_t len, timelib_time **begin, timelib_time **end, timelib_rel_time **period, int *recurrences, struct timelib_error_container **errors) diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h index b7c49888cb..552ec39221 100644 --- a/ext/date/lib/timelib.h +++ b/ext/date/lib/timelib.h @@ -68,15 +68,15 @@ int timelib_valid_time(timelib_sll h, timelib_sll i, timelib_sll s); int timelib_valid_date(timelib_sll y, timelib_sll m, timelib_sll d); /* From parse_date.re */ -timelib_time *timelib_strtotime(char *s, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper); -timelib_time *timelib_parse_from_format(char *format, char *s, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper); +timelib_time *timelib_strtotime(char *s, size_t len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper); +timelib_time *timelib_parse_from_format(char *format, char *s, size_t len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper); void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options); char *timelib_timezone_id_from_abbr(const char *abbr, timelib_long gmtoffset, int isdst); const timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void); timelib_long timelib_parse_tz_cor(char**); /* From parse_iso_intervals.re */ -void timelib_strtointerval(char *s, int len, +void timelib_strtointerval(char *s, size_t len, timelib_time **begin, timelib_time **end, timelib_rel_time **period, int *recurrences, struct timelib_error_container **errors); diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h index a23104f68c..0fd9bfbe10 100644 --- a/ext/date/lib/timezonedb.h +++ b/ext/date/lib/timezonedb.h @@ -1,4 +1,4 @@ -const timelib_tzdb_index_entry timezonedb_idx_builtin[582] = { +const timelib_tzdb_index_entry timezonedb_idx_builtin[583] = { { "Africa/Abidjan" , 0x000000 }, { "Africa/Accra" , 0x000055 }, { "Africa/Addis_Ababa" , 0x00019D }, @@ -12,578 +12,579 @@ const timelib_tzdb_index_entry timezonedb_idx_builtin[582] = { { "Africa/Blantyre" , 0x00052F }, { "Africa/Brazzaville" , 0x000584 }, { "Africa/Bujumbura" , 0x0005D9 }, - { "Africa/Cairo" , 0x00061D }, - { "Africa/Casablanca" , 0x000A04 }, - { "Africa/Ceuta" , 0x000C66 }, - { "Africa/Conakry" , 0x000F6D }, - { "Africa/Dakar" , 0x000FC2 }, - { "Africa/Dar_es_Salaam" , 0x001017 }, - { "Africa/Djibouti" , 0x001084 }, - { "Africa/Douala" , 0x0010D9 }, - { "Africa/El_Aaiun" , 0x00112E }, - { "Africa/Freetown" , 0x001359 }, - { "Africa/Gaborone" , 0x0013AE }, - { "Africa/Harare" , 0x00141B }, - { "Africa/Johannesburg" , 0x001470 }, - { "Africa/Juba" , 0x0014DE }, - { "Africa/Kampala" , 0x0015F1 }, - { "Africa/Khartoum" , 0x001670 }, - { "Africa/Kigali" , 0x001783 }, - { "Africa/Kinshasa" , 0x0017D8 }, - { "Africa/Lagos" , 0x001844 }, - { "Africa/Libreville" , 0x001899 }, - { "Africa/Lome" , 0x0018EE }, - { "Africa/Luanda" , 0x001943 }, - { "Africa/Lubumbashi" , 0x001998 }, - { "Africa/Lusaka" , 0x0019F3 }, - { "Africa/Malabo" , 0x001A48 }, - { "Africa/Maputo" , 0x001A9D }, - { "Africa/Maseru" , 0x001AF2 }, - { "Africa/Mbabane" , 0x001B5A }, - { "Africa/Mogadishu" , 0x001BB0 }, - { "Africa/Monrovia" , 0x001C0B }, - { "Africa/Nairobi" , 0x001C71 }, - { "Africa/Ndjamena" , 0x001CF0 }, - { "Africa/Niamey" , 0x001D5C }, - { "Africa/Nouakchott" , 0x001DB1 }, - { "Africa/Ouagadougou" , 0x001E06 }, - { "Africa/Porto-Novo" , 0x001E5B }, - { "Africa/Sao_Tome" , 0x001EB0 }, - { "Africa/Timbuktu" , 0x001F05 }, - { "Africa/Tripoli" , 0x001F5A }, - { "Africa/Tunis" , 0x002063 }, - { "Africa/Windhoek" , 0x002175 }, - { "America/Adak" , 0x0023BC }, - { "America/Anchorage" , 0x002732 }, - { "America/Anguilla" , 0x002AA6 }, - { "America/Antigua" , 0x002AFB }, - { "America/Araguaina" , 0x002B61 }, - { "America/Argentina/Buenos_Aires" , 0x002CC6 }, - { "America/Argentina/Catamarca" , 0x002E74 }, - { "America/Argentina/ComodRivadavia" , 0x003035 }, - { "America/Argentina/Cordoba" , 0x0031DB }, - { "America/Argentina/Jujuy" , 0x0033B0 }, - { "America/Argentina/La_Rioja" , 0x003564 }, - { "America/Argentina/Mendoza" , 0x00371C }, - { "America/Argentina/Rio_Gallegos" , 0x0038DC }, - { "America/Argentina/Salta" , 0x003A91 }, - { "America/Argentina/San_Juan" , 0x003C3D }, - { "America/Argentina/San_Luis" , 0x003DF5 }, - { "America/Argentina/Tucuman" , 0x003FBB }, - { "America/Argentina/Ushuaia" , 0x004177 }, - { "America/Aruba" , 0x004332 }, - { "America/Asuncion" , 0x004398 }, - { "America/Atikokan" , 0x00467D }, - { "America/Atka" , 0x004753 }, - { "America/Bahia" , 0x004AB9 }, - { "America/Bahia_Banderas" , 0x004C4C }, - { "America/Barbados" , 0x004EC5 }, - { "America/Belem" , 0x004F5F }, - { "America/Belize" , 0x00505A }, - { "America/Blanc-Sablon" , 0x0051D6 }, - { "America/Boa_Vista" , 0x00528A }, - { "America/Bogota" , 0x005393 }, - { "America/Boise" , 0x0053FF }, - { "America/Buenos_Aires" , 0x005796 }, - { "America/Cambridge_Bay" , 0x00592F }, - { "America/Campo_Grande" , 0x005C57 }, - { "America/Cancun" , 0x005F46 }, - { "America/Caracas" , 0x006188 }, - { "America/Catamarca" , 0x0061EF }, - { "America/Cayenne" , 0x006395 }, - { "America/Cayman" , 0x0063F7 }, - { "America/Chicago" , 0x00644C }, - { "America/Chihuahua" , 0x006963 }, - { "America/Coral_Harbour" , 0x006BCE }, - { "America/Cordoba" , 0x006C60 }, - { "America/Costa_Rica" , 0x006E06 }, - { "America/Creston" , 0x006E90 }, - { "America/Cuiaba" , 0x006F1C }, - { "America/Curacao" , 0x0071FA }, - { "America/Danmarkshavn" , 0x007260 }, - { "America/Dawson" , 0x0073A4 }, - { "America/Dawson_Creek" , 0x0076C1 }, - { "America/Denver" , 0x00789B }, - { "America/Detroit" , 0x007C21 }, - { "America/Dominica" , 0x007F80 }, - { "America/Edmonton" , 0x007FD5 }, - { "America/Eirunepe" , 0x00838D }, - { "America/El_Salvador" , 0x0084A5 }, - { "America/Ensenada" , 0x00851A }, - { "America/Fort_Wayne" , 0x0089C1 }, - { "America/Fortaleza" , 0x008883 }, - { "America/Glace_Bay" , 0x008C2B }, - { "America/Godthab" , 0x008FA2 }, - { "America/Goose_Bay" , 0x009266 }, - { "America/Grand_Turk" , 0x009723 }, - { "America/Grenada" , 0x0098F8 }, - { "America/Guadeloupe" , 0x00994D }, - { "America/Guatemala" , 0x0099A2 }, - { "America/Guayaquil" , 0x009A2B }, - { "America/Guyana" , 0x009A88 }, - { "America/Halifax" , 0x009B09 }, - { "America/Havana" , 0x00A01F }, - { "America/Hermosillo" , 0x00A392 }, - { "America/Indiana/Indianapolis" , 0x00A470 }, - { "America/Indiana/Knox" , 0x00A701 }, - { "America/Indiana/Marengo" , 0x00AA98 }, - { "America/Indiana/Petersburg" , 0x00AD3E }, - { "America/Indiana/Tell_City" , 0x00B28B }, - { "America/Indiana/Vevay" , 0x00B524 }, - { "America/Indiana/Vincennes" , 0x00B75F }, - { "America/Indiana/Winamac" , 0x00BA13 }, - { "America/Indianapolis" , 0x00B021 }, - { "America/Inuvik" , 0x00BCCC }, - { "America/Iqaluit" , 0x00BFC3 }, - { "America/Jamaica" , 0x00C2E5 }, - { "America/Jujuy" , 0x00C3AA }, - { "America/Juneau" , 0x00C554 }, - { "America/Kentucky/Louisville" , 0x00C8D2 }, - { "America/Kentucky/Monticello" , 0x00CCF0 }, - { "America/Knox_IN" , 0x00D075 }, - { "America/Kralendijk" , 0x00D3E6 }, - { "America/La_Paz" , 0x00D44C }, - { "America/Lima" , 0x00D4B3 }, - { "America/Los_Angeles" , 0x00D55B }, - { "America/Louisville" , 0x00D96C }, - { "America/Lower_Princes" , 0x00DD61 }, - { "America/Maceio" , 0x00DDC7 }, - { "America/Managua" , 0x00DF01 }, - { "America/Manaus" , 0x00DFB4 }, - { "America/Marigot" , 0x00E0B6 }, - { "America/Martinique" , 0x00E10B }, - { "America/Matamoros" , 0x00E177 }, - { "America/Mazatlan" , 0x00E3D0 }, - { "America/Mendoza" , 0x00E63D }, - { "America/Menominee" , 0x00E7F1 }, - { "America/Merida" , 0x00EB72 }, - { "America/Metlakatla" , 0x00EDAD }, - { "America/Mexico_City" , 0x00EEE8 }, - { "America/Miquelon" , 0x00F163 }, - { "America/Moncton" , 0x00F3D5 }, - { "America/Monterrey" , 0x00F86C }, - { "America/Montevideo" , 0x00FACF }, - { "America/Montreal" , 0x00FDE1 }, - { "America/Montserrat" , 0x0102D1 }, - { "America/Nassau" , 0x010326 }, - { "America/New_York" , 0x01066B }, - { "America/Nipigon" , 0x010B76 }, - { "America/Nome" , 0x010EC7 }, - { "America/Noronha" , 0x011245 }, - { "America/North_Dakota/Beulah" , 0x011375 }, - { "America/North_Dakota/Center" , 0x011709 }, - { "America/North_Dakota/New_Salem" , 0x011A9D }, - { "America/Ojinaga" , 0x011E46 }, - { "America/Panama" , 0x0120A7 }, - { "America/Pangnirtung" , 0x0120FC }, - { "America/Paramaribo" , 0x012432 }, - { "America/Phoenix" , 0x0124C4 }, - { "America/Port-au-Prince" , 0x012582 }, - { "America/Port_of_Spain" , 0x0128A6 }, - { "America/Porto_Acre" , 0x0127A2 }, - { "America/Porto_Velho" , 0x0128FB }, - { "America/Puerto_Rico" , 0x0129F1 }, - { "America/Rainy_River" , 0x012A5C }, - { "America/Rankin_Inlet" , 0x012D94 }, - { "America/Recife" , 0x01307A }, - { "America/Regina" , 0x0131A4 }, - { "America/Resolute" , 0x013362 }, - { "America/Rio_Branco" , 0x01364A }, - { "America/Rosario" , 0x013752 }, - { "America/Santa_Isabel" , 0x0138F8 }, - { "America/Santarem" , 0x013C9B }, - { "America/Santiago" , 0x013DA0 }, - { "America/Santo_Domingo" , 0x014149 }, - { "America/Sao_Paulo" , 0x01420F }, - { "America/Scoresbysund" , 0x01451E }, - { "America/Shiprock" , 0x01480C }, - { "America/Sitka" , 0x014B85 }, - { "America/St_Barthelemy" , 0x014F0D }, - { "America/St_Johns" , 0x014F62 }, - { "America/St_Kitts" , 0x0154B5 }, - { "America/St_Lucia" , 0x01550A }, - { "America/St_Thomas" , 0x01555F }, - { "America/St_Vincent" , 0x0155B4 }, - { "America/Swift_Current" , 0x015609 }, - { "America/Tegucigalpa" , 0x01572A }, - { "America/Thule" , 0x0157A9 }, - { "America/Thunder_Bay" , 0x0159F0 }, - { "America/Tijuana" , 0x015D39 }, - { "America/Toronto" , 0x0160D2 }, - { "America/Tortola" , 0x0165F2 }, - { "America/Vancouver" , 0x016647 }, - { "America/Virgin" , 0x016A84 }, - { "America/Whitehorse" , 0x016AD9 }, - { "America/Winnipeg" , 0x016DF6 }, - { "America/Yakutat" , 0x017236 }, - { "America/Yellowknife" , 0x0175A1 }, - { "Antarctica/Casey" , 0x0178B1 }, - { "Antarctica/Davis" , 0x01794F }, - { "Antarctica/DumontDUrville" , 0x0179F0 }, - { "Antarctica/Macquarie" , 0x017A81 }, - { "Antarctica/Mawson" , 0x017CCE }, - { "Antarctica/McMurdo" , 0x017D4A }, - { "Antarctica/Palmer" , 0x0180F5 }, - { "Antarctica/Rothera" , 0x018411 }, - { "Antarctica/South_Pole" , 0x018487 }, - { "Antarctica/Syowa" , 0x018805 }, - { "Antarctica/Troll" , 0x018873 }, - { "Antarctica/Vostok" , 0x018A45 }, - { "Arctic/Longyearbyen" , 0x018AB6 }, - { "Asia/Aden" , 0x018DE8 }, - { "Asia/Almaty" , 0x018E3D }, - { "Asia/Amman" , 0x018FBC }, - { "Asia/Anadyr" , 0x019272 }, - { "Asia/Aqtau" , 0x019474 }, - { "Asia/Aqtobe" , 0x019673 }, - { "Asia/Ashgabat" , 0x01982B }, - { "Asia/Ashkhabad" , 0x019948 }, - { "Asia/Baghdad" , 0x019A65 }, - { "Asia/Bahrain" , 0x019BDA }, - { "Asia/Baku" , 0x019C40 }, - { "Asia/Bangkok" , 0x019F28 }, - { "Asia/Beirut" , 0x019F7D }, - { "Asia/Bishkek" , 0x01A28A }, - { "Asia/Brunei" , 0x01A436 }, - { "Asia/Calcutta" , 0x01A498 }, - { "Asia/Chita" , 0x01A511 }, - { "Asia/Choibalsan" , 0x01A726 }, - { "Asia/Chongqing" , 0x01A89F }, - { "Asia/Chungking" , 0x01A93F }, - { "Asia/Colombo" , 0x01A9DF }, - { "Asia/Dacca" , 0x01AA7B }, - { "Asia/Damascus" , 0x01AB21 }, - { "Asia/Dhaka" , 0x01AE71 }, - { "Asia/Dili" , 0x01AF17 }, - { "Asia/Dubai" , 0x01AFA1 }, - { "Asia/Dushanbe" , 0x01AFF6 }, - { "Asia/Gaza" , 0x01B0F9 }, - { "Asia/Harbin" , 0x01B44C }, - { "Asia/Hebron" , 0x01B4EC }, - { "Asia/Ho_Chi_Minh" , 0x01B848 }, - { "Asia/Hong_Kong" , 0x01B8C0 }, - { "Asia/Hovd" , 0x01BA82 }, - { "Asia/Irkutsk" , 0x01BBFA }, - { "Asia/Istanbul" , 0x01BDE5 }, - { "Asia/Jakarta" , 0x01C1D2 }, - { "Asia/Jayapura" , 0x01C27C }, - { "Asia/Jerusalem" , 0x01C319 }, - { "Asia/Kabul" , 0x01C648 }, - { "Asia/Kamchatka" , 0x01C699 }, - { "Asia/Karachi" , 0x01C892 }, - { "Asia/Kashgar" , 0x01C947 }, - { "Asia/Kathmandu" , 0x01C99C }, - { "Asia/Katmandu" , 0x01CA02 }, - { "Asia/Khandyga" , 0x01CA68 }, - { "Asia/Kolkata" , 0x01CC92 }, - { "Asia/Krasnoyarsk" , 0x01CD0B }, - { "Asia/Kuala_Lumpur" , 0x01CEF8 }, - { "Asia/Kuching" , 0x01CFB5 }, - { "Asia/Kuwait" , 0x01D0A3 }, - { "Asia/Macao" , 0x01D0F8 }, - { "Asia/Macau" , 0x01D233 }, - { "Asia/Magadan" , 0x01D36E }, - { "Asia/Makassar" , 0x01D572 }, - { "Asia/Manila" , 0x01D637 }, - { "Asia/Muscat" , 0x01D6BC }, - { "Asia/Nicosia" , 0x01D711 }, - { "Asia/Novokuznetsk" , 0x01D9F9 }, - { "Asia/Novosibirsk" , 0x01DC19 }, - { "Asia/Omsk" , 0x01DE09 }, - { "Asia/Oral" , 0x01DFF5 }, - { "Asia/Phnom_Penh" , 0x01E1C5 }, - { "Asia/Pontianak" , 0x01E23D }, - { "Asia/Pyongyang" , 0x01E2FF }, - { "Asia/Qatar" , 0x01E38F }, - { "Asia/Qyzylorda" , 0x01E3F5 }, - { "Asia/Rangoon" , 0x01E5CB }, - { "Asia/Riyadh" , 0x01E643 }, - { "Asia/Saigon" , 0x01E698 }, - { "Asia/Sakhalin" , 0x01E710 }, - { "Asia/Samarkand" , 0x01E90D }, - { "Asia/Seoul" , 0x01EA43 }, - { "Asia/Shanghai" , 0x01EB0A }, - { "Asia/Singapore" , 0x01EBB6 }, - { "Asia/Srednekolymsk" , 0x01EC6D }, - { "Asia/Taipei" , 0x01EE6D }, - { "Asia/Tashkent" , 0x01EF9E }, - { "Asia/Tbilisi" , 0x01F0CF }, - { "Asia/Tehran" , 0x01F289 }, - { "Asia/Tel_Aviv" , 0x01F4F7 }, - { "Asia/Thimbu" , 0x01F826 }, - { "Asia/Thimphu" , 0x01F88C }, - { "Asia/Tokyo" , 0x01F8F2 }, - { "Asia/Ujung_Pandang" , 0x01F97C }, - { "Asia/Ulaanbaatar" , 0x01F9F9 }, - { "Asia/Ulan_Bator" , 0x01FB54 }, - { "Asia/Urumqi" , 0x01FCA1 }, - { "Asia/Ust-Nera" , 0x01FD03 }, - { "Asia/Vientiane" , 0x01FF15 }, - { "Asia/Vladivostok" , 0x01FF8D }, - { "Asia/Yakutsk" , 0x020177 }, - { "Asia/Yekaterinburg" , 0x020361 }, - { "Asia/Yerevan" , 0x020582 }, - { "Atlantic/Azores" , 0x020782 }, - { "Atlantic/Bermuda" , 0x020C85 }, - { "Atlantic/Canary" , 0x020F66 }, - { "Atlantic/Cape_Verde" , 0x02123C }, - { "Atlantic/Faeroe" , 0x0212B5 }, - { "Atlantic/Faroe" , 0x021559 }, - { "Atlantic/Jan_Mayen" , 0x0217FD }, - { "Atlantic/Madeira" , 0x021B2F }, - { "Atlantic/Reykjavik" , 0x022038 }, - { "Atlantic/South_Georgia" , 0x0221F1 }, - { "Atlantic/St_Helena" , 0x022403 }, - { "Atlantic/Stanley" , 0x022235 }, - { "Australia/ACT" , 0x022458 }, - { "Australia/Adelaide" , 0x02277B }, - { "Australia/Brisbane" , 0x022AAD }, - { "Australia/Broken_Hill" , 0x022B7A }, - { "Australia/Canberra" , 0x022EBE }, - { "Australia/Currie" , 0x0231E1 }, - { "Australia/Darwin" , 0x02351A }, - { "Australia/Eucla" , 0x0235A6 }, - { "Australia/Hobart" , 0x023682 }, - { "Australia/LHI" , 0x0239E6 }, - { "Australia/Lindeman" , 0x023C87 }, - { "Australia/Lord_Howe" , 0x023D6E }, - { "Australia/Melbourne" , 0x02401F }, - { "Australia/North" , 0x02434A }, - { "Australia/NSW" , 0x0243C4 }, - { "Australia/Perth" , 0x0246E7 }, - { "Australia/Queensland" , 0x0247C5 }, - { "Australia/South" , 0x024877 }, - { "Australia/Sydney" , 0x024B9A }, - { "Australia/Tasmania" , 0x024EDD }, - { "Australia/Victoria" , 0x025228 }, - { "Australia/West" , 0x02554B }, - { "Australia/Yancowinna" , 0x025607 }, - { "Brazil/Acre" , 0x02592F }, - { "Brazil/DeNoronha" , 0x025A33 }, - { "Brazil/East" , 0x025B53 }, - { "Brazil/West" , 0x025E30 }, - { "Canada/Atlantic" , 0x025F28 }, - { "Canada/Central" , 0x026410 }, - { "Canada/East-Saskatchewan" , 0x026D1A }, - { "Canada/Eastern" , 0x02682A }, - { "Canada/Mountain" , 0x026EA3 }, - { "Canada/Newfoundland" , 0x027219 }, - { "Canada/Pacific" , 0x027744 }, - { "Canada/Saskatchewan" , 0x027B5D }, - { "Canada/Yukon" , 0x027CE6 }, - { "CET" , 0x027FE9 }, - { "Chile/Continental" , 0x0282F2 }, - { "Chile/EasterIsland" , 0x02868D }, - { "CST6CDT" , 0x0289CF }, - { "Cuba" , 0x028D20 }, - { "EET" , 0x029093 }, - { "Egypt" , 0x029346 }, - { "Eire" , 0x02972D }, - { "EST" , 0x029C3E }, - { "EST5EDT" , 0x029C82 }, - { "Etc/GMT" , 0x029FD3 }, - { "Etc/GMT+0" , 0x02A09F }, - { "Etc/GMT+1" , 0x02A129 }, - { "Etc/GMT+10" , 0x02A1B6 }, - { "Etc/GMT+11" , 0x02A244 }, - { "Etc/GMT+12" , 0x02A2D2 }, - { "Etc/GMT+2" , 0x02A3ED }, - { "Etc/GMT+3" , 0x02A479 }, - { "Etc/GMT+4" , 0x02A505 }, - { "Etc/GMT+5" , 0x02A591 }, - { "Etc/GMT+6" , 0x02A61D }, - { "Etc/GMT+7" , 0x02A6A9 }, - { "Etc/GMT+8" , 0x02A735 }, - { "Etc/GMT+9" , 0x02A7C1 }, - { "Etc/GMT-0" , 0x02A05B }, - { "Etc/GMT-1" , 0x02A0E3 }, - { "Etc/GMT-10" , 0x02A16F }, - { "Etc/GMT-11" , 0x02A1FD }, - { "Etc/GMT-12" , 0x02A28B }, - { "Etc/GMT-13" , 0x02A319 }, - { "Etc/GMT-14" , 0x02A360 }, - { "Etc/GMT-2" , 0x02A3A7 }, - { "Etc/GMT-3" , 0x02A433 }, - { "Etc/GMT-4" , 0x02A4BF }, - { "Etc/GMT-5" , 0x02A54B }, - { "Etc/GMT-6" , 0x02A5D7 }, - { "Etc/GMT-7" , 0x02A663 }, - { "Etc/GMT-8" , 0x02A6EF }, - { "Etc/GMT-9" , 0x02A77B }, - { "Etc/GMT0" , 0x02A017 }, - { "Etc/Greenwich" , 0x02A807 }, - { "Etc/UCT" , 0x02A84B }, - { "Etc/Universal" , 0x02A88F }, - { "Etc/UTC" , 0x02A8D3 }, - { "Etc/Zulu" , 0x02A917 }, - { "Europe/Amsterdam" , 0x02A95B }, - { "Europe/Andorra" , 0x02AD99 }, - { "Europe/Athens" , 0x02B015 }, - { "Europe/Belfast" , 0x02B358 }, - { "Europe/Belgrade" , 0x02B88F }, - { "Europe/Berlin" , 0x02BB58 }, - { "Europe/Bratislava" , 0x02BEBC }, - { "Europe/Brussels" , 0x02C1EE }, - { "Europe/Bucharest" , 0x02C625 }, - { "Europe/Budapest" , 0x02C94F }, - { "Europe/Busingen" , 0x02CCB8 }, - { "Europe/Chisinau" , 0x02CF6F }, - { "Europe/Copenhagen" , 0x02D2FD }, - { "Europe/Dublin" , 0x02D607 }, - { "Europe/Gibraltar" , 0x02DB18 }, - { "Europe/Guernsey" , 0x02DF6F }, - { "Europe/Helsinki" , 0x02E4A6 }, - { "Europe/Isle_of_Man" , 0x02E75C }, - { "Europe/Istanbul" , 0x02EC93 }, - { "Europe/Jersey" , 0x02F080 }, - { "Europe/Kaliningrad" , 0x02F5B7 }, - { "Europe/Kiev" , 0x02F822 }, - { "Europe/Lisbon" , 0x02FB3E }, - { "Europe/Ljubljana" , 0x030042 }, - { "Europe/London" , 0x03030B }, - { "Europe/Luxembourg" , 0x030842 }, - { "Europe/Madrid" , 0x030C98 }, - { "Europe/Malta" , 0x03105E }, - { "Europe/Mariehamn" , 0x031417 }, - { "Europe/Minsk" , 0x0316CD }, - { "Europe/Monaco" , 0x0318DB }, - { "Europe/Moscow" , 0x031D16 }, - { "Europe/Nicosia" , 0x031F70 }, - { "Europe/Oslo" , 0x032258 }, - { "Europe/Paris" , 0x03258A }, - { "Europe/Podgorica" , 0x0329D0 }, - { "Europe/Prague" , 0x032C99 }, - { "Europe/Riga" , 0x032FCB }, - { "Europe/Rome" , 0x033310 }, - { "Europe/Samara" , 0x0336D3 }, - { "Europe/San_Marino" , 0x03393C }, - { "Europe/Sarajevo" , 0x033CFF }, - { "Europe/Simferopol" , 0x033FC8 }, - { "Europe/Skopje" , 0x034219 }, - { "Europe/Sofia" , 0x0344E2 }, - { "Europe/Stockholm" , 0x0347EA }, - { "Europe/Tallinn" , 0x034A99 }, - { "Europe/Tirane" , 0x034DD3 }, - { "Europe/Tiraspol" , 0x0350D9 }, - { "Europe/Uzhgorod" , 0x035467 }, - { "Europe/Vaduz" , 0x03577E }, - { "Europe/Vatican" , 0x035A2D }, - { "Europe/Vienna" , 0x035DF0 }, - { "Europe/Vilnius" , 0x03611D }, - { "Europe/Volgograd" , 0x03645C }, - { "Europe/Warsaw" , 0x03667D }, - { "Europe/Zagreb" , 0x036A5E }, - { "Europe/Zaporozhye" , 0x036D27 }, - { "Europe/Zurich" , 0x037068 }, - { "Factory" , 0x037317 }, - { "GB" , 0x037388 }, - { "GB-Eire" , 0x0378BF }, - { "GMT" , 0x037DF6 }, - { "GMT+0" , 0x037EC2 }, - { "GMT-0" , 0x037E7E }, - { "GMT0" , 0x037E3A }, - { "Greenwich" , 0x037F06 }, - { "Hongkong" , 0x037F4A }, - { "HST" , 0x03810C }, - { "Iceland" , 0x038150 }, - { "Indian/Antananarivo" , 0x038309 }, - { "Indian/Chagos" , 0x03837D }, - { "Indian/Christmas" , 0x0383DF }, - { "Indian/Cocos" , 0x038423 }, - { "Indian/Comoro" , 0x038467 }, - { "Indian/Kerguelen" , 0x0384BC }, - { "Indian/Mahe" , 0x038511 }, - { "Indian/Maldives" , 0x038566 }, - { "Indian/Mauritius" , 0x0385BB }, - { "Indian/Mayotte" , 0x038631 }, - { "Indian/Reunion" , 0x038686 }, - { "Iran" , 0x0386DB }, - { "Israel" , 0x038949 }, - { "Jamaica" , 0x038C78 }, - { "Japan" , 0x038D3D }, - { "Kwajalein" , 0x038DC7 }, - { "Libya" , 0x038E2A }, - { "MET" , 0x038F33 }, - { "Mexico/BajaNorte" , 0x03923C }, - { "Mexico/BajaSur" , 0x0395A5 }, - { "Mexico/General" , 0x0397EA }, - { "MST" , 0x039A48 }, - { "MST7MDT" , 0x039A8C }, - { "Navajo" , 0x039DDD }, - { "NZ" , 0x03A156 }, - { "NZ-CHAT" , 0x03A4D4 }, - { "Pacific/Apia" , 0x03A7B8 }, - { "Pacific/Auckland" , 0x03A954 }, - { "Pacific/Chatham" , 0x03ACE0 }, - { "Pacific/Chuuk" , 0x03AFD3 }, - { "Pacific/Easter" , 0x03B02C }, - { "Pacific/Efate" , 0x03B37B }, - { "Pacific/Enderbury" , 0x03B441 }, - { "Pacific/Fakaofo" , 0x03B4AF }, - { "Pacific/Fiji" , 0x03B500 }, - { "Pacific/Funafuti" , 0x03B693 }, - { "Pacific/Galapagos" , 0x03B6D7 }, - { "Pacific/Gambier" , 0x03B74F }, - { "Pacific/Guadalcanal" , 0x03B7B4 }, - { "Pacific/Guam" , 0x03B809 }, - { "Pacific/Honolulu" , 0x03B85F }, - { "Pacific/Johnston" , 0x03B8D6 }, - { "Pacific/Kiritimati" , 0x03B955 }, - { "Pacific/Kosrae" , 0x03B9C0 }, - { "Pacific/Kwajalein" , 0x03BA1D }, - { "Pacific/Majuro" , 0x03BA89 }, - { "Pacific/Marquesas" , 0x03BAE8 }, - { "Pacific/Midway" , 0x03BB4F }, - { "Pacific/Nauru" , 0x03BBD9 }, - { "Pacific/Niue" , 0x03BC51 }, - { "Pacific/Norfolk" , 0x03BCAF }, - { "Pacific/Noumea" , 0x03BD04 }, - { "Pacific/Pago_Pago" , 0x03BD94 }, - { "Pacific/Palau" , 0x03BE0B }, - { "Pacific/Pitcairn" , 0x03BE4F }, - { "Pacific/Pohnpei" , 0x03BEA4 }, - { "Pacific/Ponape" , 0x03BEF9 }, - { "Pacific/Port_Moresby" , 0x03BF3E }, - { "Pacific/Rarotonga" , 0x03BF82 }, - { "Pacific/Saipan" , 0x03C05E }, - { "Pacific/Samoa" , 0x03C0C1 }, - { "Pacific/Tahiti" , 0x03C138 }, - { "Pacific/Tarawa" , 0x03C19D }, - { "Pacific/Tongatapu" , 0x03C1F1 }, - { "Pacific/Truk" , 0x03C27D }, - { "Pacific/Wake" , 0x03C2C2 }, - { "Pacific/Wallis" , 0x03C312 }, - { "Pacific/Yap" , 0x03C356 }, - { "Poland" , 0x03C39B }, - { "Portugal" , 0x03C77C }, - { "PRC" , 0x03CC78 }, - { "PST8PDT" , 0x03CD18 }, - { "ROC" , 0x03D069 }, - { "ROK" , 0x03D19A }, - { "Singapore" , 0x03D261 }, - { "Turkey" , 0x03D318 }, - { "UCT" , 0x03D705 }, - { "Universal" , 0x03D749 }, - { "US/Alaska" , 0x03D78D }, - { "US/Aleutian" , 0x03DAF6 }, - { "US/Arizona" , 0x03DE5C }, - { "US/Central" , 0x03DEEA }, - { "US/East-Indiana" , 0x03E8F4 }, - { "US/Eastern" , 0x03E3F5 }, - { "US/Hawaii" , 0x03EB5E }, - { "US/Indiana-Starke" , 0x03EBCF }, - { "US/Michigan" , 0x03EF40 }, - { "US/Mountain" , 0x03F277 }, - { "US/Pacific" , 0x03F5F0 }, - { "US/Pacific-New" , 0x03F9F5 }, - { "US/Samoa" , 0x03FDFA }, - { "UTC" , 0x03FE71 }, - { "W-SU" , 0x040168 }, - { "WET" , 0x03FEB5 }, - { "Zulu" , 0x0403AB }, + { "Africa/Cairo" , 0x00062E }, + { "Africa/Casablanca" , 0x000A15 }, + { "Africa/Ceuta" , 0x000C77 }, + { "Africa/Conakry" , 0x000F7E }, + { "Africa/Dakar" , 0x000FD3 }, + { "Africa/Dar_es_Salaam" , 0x001028 }, + { "Africa/Djibouti" , 0x001095 }, + { "Africa/Douala" , 0x0010EA }, + { "Africa/El_Aaiun" , 0x00113F }, + { "Africa/Freetown" , 0x00136A }, + { "Africa/Gaborone" , 0x0013BF }, + { "Africa/Harare" , 0x001414 }, + { "Africa/Johannesburg" , 0x001469 }, + { "Africa/Juba" , 0x0014D7 }, + { "Africa/Kampala" , 0x0015EA }, + { "Africa/Khartoum" , 0x001669 }, + { "Africa/Kigali" , 0x00177C }, + { "Africa/Kinshasa" , 0x0017D1 }, + { "Africa/Lagos" , 0x00183D }, + { "Africa/Libreville" , 0x001892 }, + { "Africa/Lome" , 0x0018E7 }, + { "Africa/Luanda" , 0x00193C }, + { "Africa/Lubumbashi" , 0x001991 }, + { "Africa/Lusaka" , 0x0019FD }, + { "Africa/Malabo" , 0x001A52 }, + { "Africa/Maputo" , 0x001AA7 }, + { "Africa/Maseru" , 0x001AFC }, + { "Africa/Mbabane" , 0x001B6A }, + { "Africa/Mogadishu" , 0x001BD8 }, + { "Africa/Monrovia" , 0x001C33 }, + { "Africa/Nairobi" , 0x001C99 }, + { "Africa/Ndjamena" , 0x001D18 }, + { "Africa/Niamey" , 0x001D84 }, + { "Africa/Nouakchott" , 0x001DD9 }, + { "Africa/Ouagadougou" , 0x001E2E }, + { "Africa/Porto-Novo" , 0x001E83 }, + { "Africa/Sao_Tome" , 0x001ED8 }, + { "Africa/Timbuktu" , 0x001F2D }, + { "Africa/Tripoli" , 0x001F82 }, + { "Africa/Tunis" , 0x00208B }, + { "Africa/Windhoek" , 0x00219D }, + { "America/Adak" , 0x0023E4 }, + { "America/Anchorage" , 0x00275A }, + { "America/Anguilla" , 0x002ACE }, + { "America/Antigua" , 0x002B23 }, + { "America/Araguaina" , 0x002B89 }, + { "America/Argentina/Buenos_Aires" , 0x002CEE }, + { "America/Argentina/Catamarca" , 0x002E9C }, + { "America/Argentina/ComodRivadavia" , 0x00305D }, + { "America/Argentina/Cordoba" , 0x003203 }, + { "America/Argentina/Jujuy" , 0x0033D8 }, + { "America/Argentina/La_Rioja" , 0x00358C }, + { "America/Argentina/Mendoza" , 0x003744 }, + { "America/Argentina/Rio_Gallegos" , 0x003904 }, + { "America/Argentina/Salta" , 0x003AB9 }, + { "America/Argentina/San_Juan" , 0x003C65 }, + { "America/Argentina/San_Luis" , 0x003E1D }, + { "America/Argentina/Tucuman" , 0x003FE3 }, + { "America/Argentina/Ushuaia" , 0x00419F }, + { "America/Aruba" , 0x00435A }, + { "America/Asuncion" , 0x0043C0 }, + { "America/Atikokan" , 0x0046A5 }, + { "America/Atka" , 0x00477B }, + { "America/Bahia" , 0x004AE1 }, + { "America/Bahia_Banderas" , 0x004C74 }, + { "America/Barbados" , 0x004EED }, + { "America/Belem" , 0x004F87 }, + { "America/Belize" , 0x005082 }, + { "America/Blanc-Sablon" , 0x0051FE }, + { "America/Boa_Vista" , 0x0052B2 }, + { "America/Bogota" , 0x0053BB }, + { "America/Boise" , 0x005427 }, + { "America/Buenos_Aires" , 0x0057BE }, + { "America/Cambridge_Bay" , 0x005957 }, + { "America/Campo_Grande" , 0x005C7F }, + { "America/Cancun" , 0x005F6E }, + { "America/Caracas" , 0x0061B0 }, + { "America/Catamarca" , 0x006217 }, + { "America/Cayenne" , 0x0063BD }, + { "America/Cayman" , 0x00641F }, + { "America/Chicago" , 0x006474 }, + { "America/Chihuahua" , 0x00698B }, + { "America/Coral_Harbour" , 0x006BF6 }, + { "America/Cordoba" , 0x006C88 }, + { "America/Costa_Rica" , 0x006E2E }, + { "America/Creston" , 0x006EB8 }, + { "America/Cuiaba" , 0x006F44 }, + { "America/Curacao" , 0x007222 }, + { "America/Danmarkshavn" , 0x007288 }, + { "America/Dawson" , 0x0073CC }, + { "America/Dawson_Creek" , 0x0076E9 }, + { "America/Denver" , 0x0078C3 }, + { "America/Detroit" , 0x007C49 }, + { "America/Dominica" , 0x007FA8 }, + { "America/Edmonton" , 0x007FFD }, + { "America/Eirunepe" , 0x0083B5 }, + { "America/El_Salvador" , 0x0084CD }, + { "America/Ensenada" , 0x008542 }, + { "America/Fort_Wayne" , 0x0089E9 }, + { "America/Fortaleza" , 0x0088AB }, + { "America/Glace_Bay" , 0x008C53 }, + { "America/Godthab" , 0x008FCA }, + { "America/Goose_Bay" , 0x00928E }, + { "America/Grand_Turk" , 0x00974B }, + { "America/Grenada" , 0x009920 }, + { "America/Guadeloupe" , 0x009975 }, + { "America/Guatemala" , 0x0099CA }, + { "America/Guayaquil" , 0x009A53 }, + { "America/Guyana" , 0x009AB0 }, + { "America/Halifax" , 0x009B31 }, + { "America/Havana" , 0x00A047 }, + { "America/Hermosillo" , 0x00A3BA }, + { "America/Indiana/Indianapolis" , 0x00A498 }, + { "America/Indiana/Knox" , 0x00A729 }, + { "America/Indiana/Marengo" , 0x00AAC0 }, + { "America/Indiana/Petersburg" , 0x00AD66 }, + { "America/Indiana/Tell_City" , 0x00B2B3 }, + { "America/Indiana/Vevay" , 0x00B54C }, + { "America/Indiana/Vincennes" , 0x00B787 }, + { "America/Indiana/Winamac" , 0x00BA3B }, + { "America/Indianapolis" , 0x00B049 }, + { "America/Inuvik" , 0x00BCF4 }, + { "America/Iqaluit" , 0x00BFEB }, + { "America/Jamaica" , 0x00C30D }, + { "America/Jujuy" , 0x00C3D2 }, + { "America/Juneau" , 0x00C57C }, + { "America/Kentucky/Louisville" , 0x00C8FA }, + { "America/Kentucky/Monticello" , 0x00CD18 }, + { "America/Knox_IN" , 0x00D09D }, + { "America/Kralendijk" , 0x00D40E }, + { "America/La_Paz" , 0x00D474 }, + { "America/Lima" , 0x00D4DB }, + { "America/Los_Angeles" , 0x00D583 }, + { "America/Louisville" , 0x00D994 }, + { "America/Lower_Princes" , 0x00DD89 }, + { "America/Maceio" , 0x00DDEF }, + { "America/Managua" , 0x00DF29 }, + { "America/Manaus" , 0x00DFDC }, + { "America/Marigot" , 0x00E0DE }, + { "America/Martinique" , 0x00E133 }, + { "America/Matamoros" , 0x00E19F }, + { "America/Mazatlan" , 0x00E3F8 }, + { "America/Mendoza" , 0x00E665 }, + { "America/Menominee" , 0x00E819 }, + { "America/Merida" , 0x00EB9A }, + { "America/Metlakatla" , 0x00EDD5 }, + { "America/Mexico_City" , 0x00EF10 }, + { "America/Miquelon" , 0x00F18B }, + { "America/Moncton" , 0x00F3FD }, + { "America/Monterrey" , 0x00F894 }, + { "America/Montevideo" , 0x00FAF7 }, + { "America/Montreal" , 0x00FE09 }, + { "America/Montserrat" , 0x0102F9 }, + { "America/Nassau" , 0x01034E }, + { "America/New_York" , 0x010693 }, + { "America/Nipigon" , 0x010B9E }, + { "America/Nome" , 0x010EEF }, + { "America/Noronha" , 0x01126D }, + { "America/North_Dakota/Beulah" , 0x01139D }, + { "America/North_Dakota/Center" , 0x011731 }, + { "America/North_Dakota/New_Salem" , 0x011AC5 }, + { "America/Ojinaga" , 0x011E6E }, + { "America/Panama" , 0x0120CF }, + { "America/Pangnirtung" , 0x012124 }, + { "America/Paramaribo" , 0x01245A }, + { "America/Phoenix" , 0x0124EC }, + { "America/Port-au-Prince" , 0x0125AA }, + { "America/Port_of_Spain" , 0x0128CE }, + { "America/Porto_Acre" , 0x0127CA }, + { "America/Porto_Velho" , 0x012923 }, + { "America/Puerto_Rico" , 0x012A19 }, + { "America/Rainy_River" , 0x012A84 }, + { "America/Rankin_Inlet" , 0x012DBC }, + { "America/Recife" , 0x0130A2 }, + { "America/Regina" , 0x0131CC }, + { "America/Resolute" , 0x01338A }, + { "America/Rio_Branco" , 0x013672 }, + { "America/Rosario" , 0x01377A }, + { "America/Santa_Isabel" , 0x013920 }, + { "America/Santarem" , 0x013CC3 }, + { "America/Santiago" , 0x013DC8 }, + { "America/Santo_Domingo" , 0x014171 }, + { "America/Sao_Paulo" , 0x014237 }, + { "America/Scoresbysund" , 0x014546 }, + { "America/Shiprock" , 0x014834 }, + { "America/Sitka" , 0x014BAD }, + { "America/St_Barthelemy" , 0x014F35 }, + { "America/St_Johns" , 0x014F8A }, + { "America/St_Kitts" , 0x0154DD }, + { "America/St_Lucia" , 0x015532 }, + { "America/St_Thomas" , 0x015587 }, + { "America/St_Vincent" , 0x0155DC }, + { "America/Swift_Current" , 0x015631 }, + { "America/Tegucigalpa" , 0x015752 }, + { "America/Thule" , 0x0157D1 }, + { "America/Thunder_Bay" , 0x015A18 }, + { "America/Tijuana" , 0x015D61 }, + { "America/Toronto" , 0x0160FA }, + { "America/Tortola" , 0x01661A }, + { "America/Vancouver" , 0x01666F }, + { "America/Virgin" , 0x016AAC }, + { "America/Whitehorse" , 0x016B01 }, + { "America/Winnipeg" , 0x016E1E }, + { "America/Yakutat" , 0x01725E }, + { "America/Yellowknife" , 0x0175C9 }, + { "Antarctica/Casey" , 0x0178D9 }, + { "Antarctica/Davis" , 0x017977 }, + { "Antarctica/DumontDUrville" , 0x017A18 }, + { "Antarctica/Macquarie" , 0x017AA9 }, + { "Antarctica/Mawson" , 0x017CF6 }, + { "Antarctica/McMurdo" , 0x017D72 }, + { "Antarctica/Palmer" , 0x01811D }, + { "Antarctica/Rothera" , 0x018439 }, + { "Antarctica/South_Pole" , 0x0184AF }, + { "Antarctica/Syowa" , 0x01882D }, + { "Antarctica/Troll" , 0x01889B }, + { "Antarctica/Vostok" , 0x018A6D }, + { "Arctic/Longyearbyen" , 0x018ADE }, + { "Asia/Aden" , 0x018E10 }, + { "Asia/Almaty" , 0x018E65 }, + { "Asia/Amman" , 0x018FE4 }, + { "Asia/Anadyr" , 0x01929A }, + { "Asia/Aqtau" , 0x01949C }, + { "Asia/Aqtobe" , 0x01969B }, + { "Asia/Ashgabat" , 0x019853 }, + { "Asia/Ashkhabad" , 0x019970 }, + { "Asia/Baghdad" , 0x019A8D }, + { "Asia/Bahrain" , 0x019C02 }, + { "Asia/Baku" , 0x019C68 }, + { "Asia/Bangkok" , 0x019F50 }, + { "Asia/Beirut" , 0x019FA5 }, + { "Asia/Bishkek" , 0x01A2B2 }, + { "Asia/Brunei" , 0x01A45E }, + { "Asia/Calcutta" , 0x01A4C0 }, + { "Asia/Chita" , 0x01A539 }, + { "Asia/Choibalsan" , 0x01A74E }, + { "Asia/Chongqing" , 0x01A8C7 }, + { "Asia/Chungking" , 0x01A967 }, + { "Asia/Colombo" , 0x01AA07 }, + { "Asia/Dacca" , 0x01AAA3 }, + { "Asia/Damascus" , 0x01AB49 }, + { "Asia/Dhaka" , 0x01AE99 }, + { "Asia/Dili" , 0x01AF3F }, + { "Asia/Dubai" , 0x01AFC9 }, + { "Asia/Dushanbe" , 0x01B01E }, + { "Asia/Gaza" , 0x01B121 }, + { "Asia/Harbin" , 0x01B474 }, + { "Asia/Hebron" , 0x01B514 }, + { "Asia/Ho_Chi_Minh" , 0x01B870 }, + { "Asia/Hong_Kong" , 0x01B912 }, + { "Asia/Hovd" , 0x01BAD4 }, + { "Asia/Irkutsk" , 0x01BC4C }, + { "Asia/Istanbul" , 0x01BE37 }, + { "Asia/Jakarta" , 0x01C224 }, + { "Asia/Jayapura" , 0x01C2CE }, + { "Asia/Jerusalem" , 0x01C36B }, + { "Asia/Kabul" , 0x01C69A }, + { "Asia/Kamchatka" , 0x01C6EB }, + { "Asia/Karachi" , 0x01C8E4 }, + { "Asia/Kashgar" , 0x01C999 }, + { "Asia/Kathmandu" , 0x01C9EE }, + { "Asia/Katmandu" , 0x01CA54 }, + { "Asia/Khandyga" , 0x01CABA }, + { "Asia/Kolkata" , 0x01CCE4 }, + { "Asia/Krasnoyarsk" , 0x01CD5D }, + { "Asia/Kuala_Lumpur" , 0x01CF4A }, + { "Asia/Kuching" , 0x01D007 }, + { "Asia/Kuwait" , 0x01D0F5 }, + { "Asia/Macao" , 0x01D14A }, + { "Asia/Macau" , 0x01D285 }, + { "Asia/Magadan" , 0x01D3C0 }, + { "Asia/Makassar" , 0x01D5C4 }, + { "Asia/Manila" , 0x01D689 }, + { "Asia/Muscat" , 0x01D70E }, + { "Asia/Nicosia" , 0x01D763 }, + { "Asia/Novokuznetsk" , 0x01DA4B }, + { "Asia/Novosibirsk" , 0x01DC6B }, + { "Asia/Omsk" , 0x01DE5B }, + { "Asia/Oral" , 0x01E047 }, + { "Asia/Phnom_Penh" , 0x01E217 }, + { "Asia/Pontianak" , 0x01E26C }, + { "Asia/Pyongyang" , 0x01E32E }, + { "Asia/Qatar" , 0x01E3BE }, + { "Asia/Qyzylorda" , 0x01E424 }, + { "Asia/Rangoon" , 0x01E5FA }, + { "Asia/Riyadh" , 0x01E672 }, + { "Asia/Saigon" , 0x01E6C7 }, + { "Asia/Sakhalin" , 0x01E769 }, + { "Asia/Samarkand" , 0x01E966 }, + { "Asia/Seoul" , 0x01EA9C }, + { "Asia/Shanghai" , 0x01EB63 }, + { "Asia/Singapore" , 0x01EC0F }, + { "Asia/Srednekolymsk" , 0x01ECC6 }, + { "Asia/Taipei" , 0x01EEC6 }, + { "Asia/Tashkent" , 0x01EFF7 }, + { "Asia/Tbilisi" , 0x01F128 }, + { "Asia/Tehran" , 0x01F2E2 }, + { "Asia/Tel_Aviv" , 0x01F550 }, + { "Asia/Thimbu" , 0x01F87F }, + { "Asia/Thimphu" , 0x01F8E5 }, + { "Asia/Tokyo" , 0x01F94B }, + { "Asia/Ujung_Pandang" , 0x01F9D5 }, + { "Asia/Ulaanbaatar" , 0x01FA52 }, + { "Asia/Ulan_Bator" , 0x01FBAD }, + { "Asia/Urumqi" , 0x01FCFA }, + { "Asia/Ust-Nera" , 0x01FD5C }, + { "Asia/Vientiane" , 0x01FF6E }, + { "Asia/Vladivostok" , 0x01FFC3 }, + { "Asia/Yakutsk" , 0x0201AD }, + { "Asia/Yekaterinburg" , 0x020397 }, + { "Asia/Yerevan" , 0x0205B8 }, + { "Atlantic/Azores" , 0x0207B8 }, + { "Atlantic/Bermuda" , 0x020CBB }, + { "Atlantic/Canary" , 0x020F9C }, + { "Atlantic/Cape_Verde" , 0x021272 }, + { "Atlantic/Faeroe" , 0x0212EB }, + { "Atlantic/Faroe" , 0x02158F }, + { "Atlantic/Jan_Mayen" , 0x021833 }, + { "Atlantic/Madeira" , 0x021B65 }, + { "Atlantic/Reykjavik" , 0x02206E }, + { "Atlantic/South_Georgia" , 0x022227 }, + { "Atlantic/St_Helena" , 0x022439 }, + { "Atlantic/Stanley" , 0x02226B }, + { "Australia/ACT" , 0x02248E }, + { "Australia/Adelaide" , 0x0227B1 }, + { "Australia/Brisbane" , 0x022AE3 }, + { "Australia/Broken_Hill" , 0x022BB0 }, + { "Australia/Canberra" , 0x022EF4 }, + { "Australia/Currie" , 0x023217 }, + { "Australia/Darwin" , 0x023550 }, + { "Australia/Eucla" , 0x0235DC }, + { "Australia/Hobart" , 0x0236B8 }, + { "Australia/LHI" , 0x023A1C }, + { "Australia/Lindeman" , 0x023CBD }, + { "Australia/Lord_Howe" , 0x023DA4 }, + { "Australia/Melbourne" , 0x024055 }, + { "Australia/North" , 0x024380 }, + { "Australia/NSW" , 0x0243FA }, + { "Australia/Perth" , 0x02471D }, + { "Australia/Queensland" , 0x0247FB }, + { "Australia/South" , 0x0248AD }, + { "Australia/Sydney" , 0x024BD0 }, + { "Australia/Tasmania" , 0x024F13 }, + { "Australia/Victoria" , 0x02525E }, + { "Australia/West" , 0x025581 }, + { "Australia/Yancowinna" , 0x02563D }, + { "Brazil/Acre" , 0x025965 }, + { "Brazil/DeNoronha" , 0x025A69 }, + { "Brazil/East" , 0x025B89 }, + { "Brazil/West" , 0x025E66 }, + { "Canada/Atlantic" , 0x025F5E }, + { "Canada/Central" , 0x026446 }, + { "Canada/East-Saskatchewan" , 0x026D50 }, + { "Canada/Eastern" , 0x026860 }, + { "Canada/Mountain" , 0x026ED9 }, + { "Canada/Newfoundland" , 0x02724F }, + { "Canada/Pacific" , 0x02777A }, + { "Canada/Saskatchewan" , 0x027B93 }, + { "Canada/Yukon" , 0x027D1C }, + { "CET" , 0x02801F }, + { "Chile/Continental" , 0x028328 }, + { "Chile/EasterIsland" , 0x0286C3 }, + { "CST6CDT" , 0x028A05 }, + { "Cuba" , 0x028D56 }, + { "EET" , 0x0290C9 }, + { "Egypt" , 0x02937C }, + { "Eire" , 0x029763 }, + { "EST" , 0x029C74 }, + { "EST5EDT" , 0x029CB8 }, + { "Etc/GMT" , 0x02A009 }, + { "Etc/GMT+0" , 0x02A0D5 }, + { "Etc/GMT+1" , 0x02A15F }, + { "Etc/GMT+10" , 0x02A1EC }, + { "Etc/GMT+11" , 0x02A27A }, + { "Etc/GMT+12" , 0x02A308 }, + { "Etc/GMT+2" , 0x02A423 }, + { "Etc/GMT+3" , 0x02A4AF }, + { "Etc/GMT+4" , 0x02A53B }, + { "Etc/GMT+5" , 0x02A5C7 }, + { "Etc/GMT+6" , 0x02A653 }, + { "Etc/GMT+7" , 0x02A6DF }, + { "Etc/GMT+8" , 0x02A76B }, + { "Etc/GMT+9" , 0x02A7F7 }, + { "Etc/GMT-0" , 0x02A091 }, + { "Etc/GMT-1" , 0x02A119 }, + { "Etc/GMT-10" , 0x02A1A5 }, + { "Etc/GMT-11" , 0x02A233 }, + { "Etc/GMT-12" , 0x02A2C1 }, + { "Etc/GMT-13" , 0x02A34F }, + { "Etc/GMT-14" , 0x02A396 }, + { "Etc/GMT-2" , 0x02A3DD }, + { "Etc/GMT-3" , 0x02A469 }, + { "Etc/GMT-4" , 0x02A4F5 }, + { "Etc/GMT-5" , 0x02A581 }, + { "Etc/GMT-6" , 0x02A60D }, + { "Etc/GMT-7" , 0x02A699 }, + { "Etc/GMT-8" , 0x02A725 }, + { "Etc/GMT-9" , 0x02A7B1 }, + { "Etc/GMT0" , 0x02A04D }, + { "Etc/Greenwich" , 0x02A83D }, + { "Etc/UCT" , 0x02A881 }, + { "Etc/Universal" , 0x02A8C5 }, + { "Etc/UTC" , 0x02A909 }, + { "Etc/Zulu" , 0x02A94D }, + { "Europe/Amsterdam" , 0x02A991 }, + { "Europe/Andorra" , 0x02ADCF }, + { "Europe/Athens" , 0x02B04B }, + { "Europe/Belfast" , 0x02B38E }, + { "Europe/Belgrade" , 0x02B8C5 }, + { "Europe/Berlin" , 0x02BB8E }, + { "Europe/Bratislava" , 0x02BEF2 }, + { "Europe/Brussels" , 0x02C224 }, + { "Europe/Bucharest" , 0x02C65B }, + { "Europe/Budapest" , 0x02C985 }, + { "Europe/Busingen" , 0x02CCEE }, + { "Europe/Chisinau" , 0x02CFA5 }, + { "Europe/Copenhagen" , 0x02D333 }, + { "Europe/Dublin" , 0x02D63D }, + { "Europe/Gibraltar" , 0x02DB4E }, + { "Europe/Guernsey" , 0x02DFA5 }, + { "Europe/Helsinki" , 0x02E4DC }, + { "Europe/Isle_of_Man" , 0x02E792 }, + { "Europe/Istanbul" , 0x02ECC9 }, + { "Europe/Jersey" , 0x02F0B6 }, + { "Europe/Kaliningrad" , 0x02F5ED }, + { "Europe/Kiev" , 0x02F858 }, + { "Europe/Lisbon" , 0x02FB74 }, + { "Europe/Ljubljana" , 0x030078 }, + { "Europe/London" , 0x030341 }, + { "Europe/Luxembourg" , 0x030878 }, + { "Europe/Madrid" , 0x030CCE }, + { "Europe/Malta" , 0x031094 }, + { "Europe/Mariehamn" , 0x03144D }, + { "Europe/Minsk" , 0x031703 }, + { "Europe/Monaco" , 0x031916 }, + { "Europe/Moscow" , 0x031D51 }, + { "Europe/Nicosia" , 0x031FAB }, + { "Europe/Oslo" , 0x032293 }, + { "Europe/Paris" , 0x0325C5 }, + { "Europe/Podgorica" , 0x032A0B }, + { "Europe/Prague" , 0x032CD4 }, + { "Europe/Riga" , 0x033006 }, + { "Europe/Rome" , 0x03334B }, + { "Europe/Samara" , 0x03370E }, + { "Europe/San_Marino" , 0x033977 }, + { "Europe/Sarajevo" , 0x033D3A }, + { "Europe/Simferopol" , 0x034003 }, + { "Europe/Skopje" , 0x034254 }, + { "Europe/Sofia" , 0x03451D }, + { "Europe/Stockholm" , 0x034825 }, + { "Europe/Tallinn" , 0x034AD4 }, + { "Europe/Tirane" , 0x034E0E }, + { "Europe/Tiraspol" , 0x035114 }, + { "Europe/Uzhgorod" , 0x0354A2 }, + { "Europe/Vaduz" , 0x0357B9 }, + { "Europe/Vatican" , 0x035A68 }, + { "Europe/Vienna" , 0x035E2B }, + { "Europe/Vilnius" , 0x036158 }, + { "Europe/Volgograd" , 0x036497 }, + { "Europe/Warsaw" , 0x0366B8 }, + { "Europe/Zagreb" , 0x036A99 }, + { "Europe/Zaporozhye" , 0x036D62 }, + { "Europe/Zurich" , 0x0370A3 }, + { "Factory" , 0x037352 }, + { "GB" , 0x0373C3 }, + { "GB-Eire" , 0x0378FA }, + { "GMT" , 0x037E31 }, + { "GMT+0" , 0x037EFD }, + { "GMT-0" , 0x037EB9 }, + { "GMT0" , 0x037E75 }, + { "Greenwich" , 0x037F41 }, + { "Hongkong" , 0x037F85 }, + { "HST" , 0x038147 }, + { "Iceland" , 0x03818B }, + { "Indian/Antananarivo" , 0x038344 }, + { "Indian/Chagos" , 0x0383B8 }, + { "Indian/Christmas" , 0x03841A }, + { "Indian/Cocos" , 0x03845E }, + { "Indian/Comoro" , 0x0384A2 }, + { "Indian/Kerguelen" , 0x0384F7 }, + { "Indian/Mahe" , 0x03854C }, + { "Indian/Maldives" , 0x0385A1 }, + { "Indian/Mauritius" , 0x0385F6 }, + { "Indian/Mayotte" , 0x03866C }, + { "Indian/Reunion" , 0x0386C1 }, + { "Iran" , 0x038716 }, + { "Israel" , 0x038984 }, + { "Jamaica" , 0x038CB3 }, + { "Japan" , 0x038D78 }, + { "Kwajalein" , 0x038E02 }, + { "Libya" , 0x038E65 }, + { "MET" , 0x038F6E }, + { "Mexico/BajaNorte" , 0x039277 }, + { "Mexico/BajaSur" , 0x0395E0 }, + { "Mexico/General" , 0x039825 }, + { "MST" , 0x039A83 }, + { "MST7MDT" , 0x039AC7 }, + { "Navajo" , 0x039E18 }, + { "NZ" , 0x03A191 }, + { "NZ-CHAT" , 0x03A50F }, + { "Pacific/Apia" , 0x03A7F3 }, + { "Pacific/Auckland" , 0x03A98F }, + { "Pacific/Bougainville" , 0x03AD1B }, + { "Pacific/Chatham" , 0x03AD92 }, + { "Pacific/Chuuk" , 0x03B085 }, + { "Pacific/Easter" , 0x03B0DE }, + { "Pacific/Efate" , 0x03B42D }, + { "Pacific/Enderbury" , 0x03B4F3 }, + { "Pacific/Fakaofo" , 0x03B561 }, + { "Pacific/Fiji" , 0x03B5B2 }, + { "Pacific/Funafuti" , 0x03B745 }, + { "Pacific/Galapagos" , 0x03B789 }, + { "Pacific/Gambier" , 0x03B801 }, + { "Pacific/Guadalcanal" , 0x03B866 }, + { "Pacific/Guam" , 0x03B8BB }, + { "Pacific/Honolulu" , 0x03B911 }, + { "Pacific/Johnston" , 0x03B988 }, + { "Pacific/Kiritimati" , 0x03BA07 }, + { "Pacific/Kosrae" , 0x03BA72 }, + { "Pacific/Kwajalein" , 0x03BACF }, + { "Pacific/Majuro" , 0x03BB3B }, + { "Pacific/Marquesas" , 0x03BB9A }, + { "Pacific/Midway" , 0x03BC01 }, + { "Pacific/Nauru" , 0x03BC8B }, + { "Pacific/Niue" , 0x03BD03 }, + { "Pacific/Norfolk" , 0x03BD61 }, + { "Pacific/Noumea" , 0x03BDB6 }, + { "Pacific/Pago_Pago" , 0x03BE46 }, + { "Pacific/Palau" , 0x03BEBD }, + { "Pacific/Pitcairn" , 0x03BF01 }, + { "Pacific/Pohnpei" , 0x03BF56 }, + { "Pacific/Ponape" , 0x03BFAB }, + { "Pacific/Port_Moresby" , 0x03BFF0 }, + { "Pacific/Rarotonga" , 0x03C042 }, + { "Pacific/Saipan" , 0x03C11E }, + { "Pacific/Samoa" , 0x03C181 }, + { "Pacific/Tahiti" , 0x03C1F8 }, + { "Pacific/Tarawa" , 0x03C25D }, + { "Pacific/Tongatapu" , 0x03C2B1 }, + { "Pacific/Truk" , 0x03C33D }, + { "Pacific/Wake" , 0x03C382 }, + { "Pacific/Wallis" , 0x03C3D2 }, + { "Pacific/Yap" , 0x03C416 }, + { "Poland" , 0x03C45B }, + { "Portugal" , 0x03C83C }, + { "PRC" , 0x03CD38 }, + { "PST8PDT" , 0x03CDD8 }, + { "ROC" , 0x03D129 }, + { "ROK" , 0x03D25A }, + { "Singapore" , 0x03D321 }, + { "Turkey" , 0x03D3D8 }, + { "UCT" , 0x03D7C5 }, + { "Universal" , 0x03D809 }, + { "US/Alaska" , 0x03D84D }, + { "US/Aleutian" , 0x03DBB6 }, + { "US/Arizona" , 0x03DF1C }, + { "US/Central" , 0x03DFAA }, + { "US/East-Indiana" , 0x03E9B4 }, + { "US/Eastern" , 0x03E4B5 }, + { "US/Hawaii" , 0x03EC1E }, + { "US/Indiana-Starke" , 0x03EC8F }, + { "US/Michigan" , 0x03F000 }, + { "US/Mountain" , 0x03F337 }, + { "US/Pacific" , 0x03F6B0 }, + { "US/Pacific-New" , 0x03FAB5 }, + { "US/Samoa" , 0x03FEBA }, + { "UTC" , 0x03FF31 }, + { "W-SU" , 0x040228 }, + { "WET" , 0x03FF75 }, + { "Zulu" , 0x04046B }, }; /* This is a generated file, do not modify */ -const unsigned char timelib_timezone_db_data_builtin[263151] = { +const unsigned char timelib_timezone_db_data_builtin[263343] = { /* Africa/Abidjan */ @@ -698,8 +699,8 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Africa/Blantyre */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC3, 0xB0, -0x01, 0x00, 0x00, 0x20, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4, +0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0x3E, 0xE2, 0x01, 0x48, 0x10, 0x60, 0x00, 0x00, 0x00, 0x00, @@ -713,10 +714,11 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Africa/Bujumbura */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, -0x00, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x84, 0x2A, 0xA2, 0x01, 0x3F, 0x77, 0xDA, -0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4, +0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x2A, 0xA2, 0x01, 0x3F, 0x77, +0xDA, 0x00, 0x00, 0x00, 0x00, /* Africa/Cairo */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -963,18 +965,17 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Africa/Gaborone */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0E, 0x82, 0x46, 0xCF, 0x68, -0xCE, 0x8E, 0x6E, 0x80, 0xCF, 0x7E, 0x51, 0x70, 0x01, 0x02, 0x01, 0x00, 0x00, 0x15, 0x18, 0x00, -0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x09, 0x53, 0x41, 0x53, -0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x43, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x63, 0xB7, 0x57, 0x01, 0x3A, 0x34, 0x32, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4, +0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0xB7, 0x57, 0x01, 0x3A, 0x34, +0x32, 0x00, 0x00, 0x00, 0x00, /* Africa/Harare */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x5A, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC7, 0x64, -0x01, 0x00, 0x00, 0x1D, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4, +0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6E, 0x1E, 0x1A, 0x01, 0x42, 0x09, 0x68, 0x00, 0x00, 0x00, 0x00, @@ -1040,8 +1041,8 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Africa/Kigali */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xBE, 0xF1, 0x0E, 0x50, -0x01, 0x00, 0x00, 0x1C, 0x30, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4, +0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x5A, 0x88, 0x01, 0x40, 0x89, 0x4A, 0x00, 0x00, 0x00, 0x00, @@ -1088,17 +1089,18 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Africa/Lubumbashi */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x1C, 0x20, -0x00, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x77, 0x86, 0xF5, 0x01, 0x3C, 0x91, 0xAA, -0x00, 0x00, 0x00, 0x17, 0x65, 0x61, 0x73, 0x74, 0x20, 0x44, 0x65, 0x6D, 0x2E, 0x20, 0x52, 0x65, -0x70, 0x2E, 0x20, 0x6F, 0x66, 0x20, 0x43, 0x6F, 0x6E, 0x67, 0x6F, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4, +0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x86, 0xF5, 0x01, 0x3C, 0x91, +0xAA, 0x00, 0x00, 0x00, 0x17, 0x65, 0x61, 0x73, 0x74, 0x20, 0x44, 0x65, 0x6D, 0x2E, 0x20, 0x52, +0x65, 0x70, 0x2E, 0x20, 0x6F, 0x66, 0x20, 0x43, 0x6F, 0x6E, 0x67, 0x6F, /* Africa/Lusaka */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x5A, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC9, 0xFC, -0x01, 0x00, 0x00, 0x1A, 0x84, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4, +0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0xCE, 0x1D, 0x01, 0x3D, 0xD0, 0xAD, 0x00, 0x00, 0x00, 0x00, @@ -1121,19 +1123,20 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Africa/Maseru */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0x82, 0x46, 0xCA, 0xB8, -0xCE, 0x8E, 0x6E, 0x80, 0xCF, 0x7E, 0x51, 0x70, 0x01, 0x02, 0x01, 0x00, 0x00, 0x19, 0xC8, 0x00, -0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x5D, 0xD5, -0x01, 0x3C, 0x9E, 0xB0, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x82, 0x46, 0xCF, 0x68, +0xCC, 0xAE, 0x8C, 0x80, 0xCD, 0x9E, 0x6F, 0x70, 0xCE, 0x8E, 0x6E, 0x80, 0xCF, 0x7E, 0x51, 0x70, +0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x15, 0x18, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, +0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x5C, 0x5D, 0xD5, 0x01, 0x3C, 0x9E, 0xB0, 0x00, 0x00, 0x00, 0x00, /* Africa/Mbabane */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x82, 0x46, 0xC7, 0x58, -0x01, 0x00, 0x00, 0x1D, 0x28, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54, -0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0x32, 0xD0, 0x01, 0x42, -0x1C, 0xF0, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x82, 0x46, 0xCF, 0x68, +0xCC, 0xAE, 0x8C, 0x80, 0xCD, 0x9E, 0x6F, 0x70, 0xCE, 0x8E, 0x6E, 0x80, 0xCF, 0x7E, 0x51, 0x70, +0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x15, 0x18, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, +0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x61, 0x32, 0xD0, 0x01, 0x42, 0x1C, 0xF0, 0x00, 0x00, 0x00, 0x00, /* Africa/Mogadishu */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -4056,7 +4059,7 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { 0x50, 0x48, 0x50, 0x31, 0x01, 0x4A, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB4, 0xFF, -0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, +0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, @@ -8302,13 +8305,16 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Asia/Ho_Chi_Minh */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x56, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x88, 0x6F, 0x42, 0x80, -0x91, 0x5F, 0xEE, 0xD0, 0x93, 0x85, 0xB1, 0x90, 0xB7, 0x41, 0xBC, 0x00, 0x01, 0x02, 0x03, 0x02, -0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, -0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x4D, 0x54, 0x00, -0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, 0xBB, 0x78, -0x01, 0xB5, 0x6B, 0x2A, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x15, 0x88, 0x8C, 0x43, 0x80, +0x91, 0xA3, 0x2B, 0x0A, 0xCD, 0x35, 0xE6, 0x80, 0xD1, 0x59, 0xCE, 0x70, 0xD2, 0x3B, 0x3E, 0xF0, +0xD5, 0x32, 0xBB, 0x10, 0xE4, 0xB6, 0xE4, 0x80, 0xED, 0x2F, 0x98, 0x00, 0x0A, 0x3D, 0xC7, 0x00, +0x01, 0x02, 0x03, 0x04, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, +0x00, 0x63, 0xF6, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x00, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, +0x0D, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x11, 0x4C, 0x4D, 0x54, 0x00, 0x50, 0x4C, 0x4D, 0x54, 0x00, +0x49, 0x43, 0x54, 0x00, 0x49, 0x44, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, 0xBB, 0x78, 0x01, 0xB5, 0x6B, 0x2A, 0x00, 0x00, +0x00, 0x00, /* Asia/Hong_Kong */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x48, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -8909,7 +8915,7 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Asia/Novokuznetsk */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1A, 0xA1, 0xF9, 0x13, 0x40, +0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1A, 0xAA, 0x18, 0x20, 0xC0, 0xB5, 0xA3, 0xE1, 0x20, 0x15, 0x27, 0x6F, 0x90, 0x16, 0x18, 0xA4, 0x00, 0x17, 0x08, 0xA3, 0x10, 0x17, 0xF9, 0xD7, 0x80, 0x18, 0xE9, 0xD6, 0x90, 0x19, 0xDB, 0x0B, 0x00, 0x1A, 0xCC, 0x5B, 0x90, 0x1B, 0xBC, 0x68, 0xB0, 0x1C, 0xAC, 0x59, 0xB0, 0x1D, 0x9C, 0x4A, 0xB0, 0x1E, 0x8C, 0x3B, 0xB0, @@ -8934,7 +8940,7 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { 0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x70, 0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x0F, 0x00, 0x00, 0x54, 0x60, 0x00, 0x15, 0x00, 0x00, 0x62, -0x70, 0x00, 0x15, 0x4E, 0x4D, 0x54, 0x00, 0x4B, 0x52, 0x41, 0x54, 0x00, 0x4B, 0x52, 0x41, 0x53, +0x70, 0x00, 0x15, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x52, 0x41, 0x54, 0x00, 0x4B, 0x52, 0x41, 0x53, 0x54, 0x00, 0x4E, 0x4F, 0x56, 0x53, 0x54, 0x00, 0x4E, 0x4F, 0x56, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDB, 0x58, 0x58, 0x01, 0x97, 0x96, 0x72, 0x00, 0x00, 0x00, 0x31, 0x4D, @@ -9044,13 +9050,11 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Asia/Phnom_Penh */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x88, 0x6F, 0x44, 0x24, -0x91, 0x5F, 0xEE, 0xD0, 0x93, 0x85, 0xB1, 0x90, 0xB7, 0x41, 0xBC, 0x00, 0x01, 0x02, 0x03, 0x02, -0x00, 0x00, 0x62, 0x5C, 0x00, 0x00, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, -0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x4D, 0x54, 0x00, -0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xF3, 0xF8, -0x01, 0xB2, 0xBF, 0x92, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA2, 0x6A, 0x67, 0xC4, +0x01, 0x00, 0x00, 0x5E, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x42, 0x4D, 0x54, +0x00, 0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xF3, 0xF8, 0x01, 0xB2, 0xBF, +0x92, 0x00, 0x00, 0x00, 0x00, /* Asia/Pontianak */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -9140,13 +9144,16 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Asia/Saigon */ 0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x88, 0x6F, 0x42, 0x80, -0x91, 0x5F, 0xEE, 0xD0, 0x93, 0x85, 0xB1, 0x90, 0xB7, 0x41, 0xBC, 0x00, 0x01, 0x02, 0x03, 0x02, -0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, -0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x4D, 0x54, 0x00, -0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, -0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x15, 0x88, 0x8C, 0x43, 0x80, +0x91, 0xA3, 0x2B, 0x0A, 0xCD, 0x35, 0xE6, 0x80, 0xD1, 0x59, 0xCE, 0x70, 0xD2, 0x3B, 0x3E, 0xF0, +0xD5, 0x32, 0xBB, 0x10, 0xE4, 0xB6, 0xE4, 0x80, 0xED, 0x2F, 0x98, 0x00, 0x0A, 0x3D, 0xC7, 0x00, +0x01, 0x02, 0x03, 0x04, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, +0x00, 0x63, 0xF6, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x00, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00, +0x0D, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x11, 0x4C, 0x4D, 0x54, 0x00, 0x50, 0x4C, 0x4D, 0x54, 0x00, +0x49, 0x43, 0x54, 0x00, 0x49, 0x44, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, +0x00, 0x00, /* Asia/Sakhalin */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -9582,13 +9589,11 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Asia/Vientiane */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x88, 0x6F, 0x46, 0x50, -0x91, 0x5F, 0xEE, 0xD0, 0x93, 0x85, 0xB1, 0x90, 0xB7, 0x41, 0xBC, 0x00, 0x01, 0x02, 0x03, 0x02, -0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, -0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x4D, 0x54, 0x00, -0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA4, 0xBE, 0x7A, -0x01, 0xAF, 0x36, 0xA0, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA2, 0x6A, 0x67, 0xC4, +0x01, 0x00, 0x00, 0x5E, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x42, 0x4D, 0x54, +0x00, 0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA4, 0xBE, 0x7A, 0x01, 0xAF, 0x36, +0xA0, 0x00, 0x00, 0x00, 0x00, /* Asia/Vladivostok */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -14389,7 +14394,7 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { /* Europe/Minsk */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x22, 0xAA, 0x19, 0xAA, 0x38, +0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x22, 0xAA, 0x19, 0xAA, 0x38, 0xB5, 0xA4, 0x19, 0x60, 0xCA, 0x5E, 0x70, 0xD0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90, 0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x0A, 0x02, 0x60, 0x15, 0x27, 0xA7, 0xD0, 0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0, @@ -14406,20 +14411,21 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { 0x40, 0x66, 0x15, 0x80, 0x41, 0x84, 0x2B, 0x00, 0x42, 0x45, 0xF7, 0x80, 0x43, 0x64, 0x0D, 0x00, 0x44, 0x25, 0xD9, 0x80, 0x45, 0x43, 0xEF, 0x00, 0x46, 0x05, 0xBB, 0x80, 0x47, 0x23, 0xD1, 0x00, 0x47, 0xEE, 0xD8, 0x00, 0x49, 0x03, 0xB3, 0x00, 0x49, 0xCE, 0xBA, 0x00, 0x4A, 0xE3, 0x95, 0x00, -0x4B, 0xAE, 0x9C, 0x00, 0x4C, 0xCC, 0xB1, 0x80, 0x4D, 0x8E, 0x7E, 0x00, 0x01, 0x02, 0x05, 0x03, -0x04, 0x03, 0x04, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x07, 0x08, 0x07, 0x08, 0x07, -0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x02, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, +0x4B, 0xAE, 0x9C, 0x00, 0x4C, 0xCC, 0xB1, 0x80, 0x4D, 0x8E, 0x7E, 0x00, 0x54, 0x4C, 0x1D, 0x60, +0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x07, +0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x02, 0x09, 0x0A, 0x09, 0x0A, 0x09, +0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, -0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x0B, -0x00, 0x00, 0x19, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, -0x00, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, -0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, -0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x1C, 0x20, -0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x1E, 0x4D, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, -0x4D, 0x53, 0x4B, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44, -0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x46, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, -0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0xDB, 0x92, 0xF0, 0x01, 0x3C, 0xB8, 0xBA, 0x00, 0x00, 0x00, 0x00, +0x0A, 0x09, 0x0A, 0x0B, 0x07, 0x00, 0x00, 0x19, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, +0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x1C, +0x20, 0x01, 0x10, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, +0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x01, +0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x1E, 0x4D, 0x4D, 0x54, +0x00, 0x45, 0x45, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, +0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x46, 0x45, 0x54, 0x00, 0x00, +0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDB, 0x92, 0xF0, 0x01, 0x3C, 0xB8, 0xBA, 0x00, +0x00, 0x00, 0x00, /* Europe/Monaco */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -16412,7 +16418,7 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { 0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB4, 0xFF, -0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, +0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60, 0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0, 0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, @@ -16964,6 +16970,16 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { 0x00, 0x00, 0x00, 0x51, 0x13, 0x35, 0x02, 0x1D, 0x54, 0xBA, 0x00, 0x00, 0x00, 0x0E, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73, +/* Pacific/Bougainville */ +0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xCC, 0x43, 0x36, 0x60, +0xD2, 0x2B, 0x6C, 0xF0, 0x54, 0x9E, 0xD7, 0x80, 0x01, 0x00, 0x02, 0x00, 0x00, 0x8C, 0xA0, 0x00, +0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x08, 0x50, 0x47, 0x54, +0x00, 0x4A, 0x53, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x7F, 0xD7, 0xDD, 0x02, 0x00, 0x08, 0xBA, 0x00, 0x00, 0x00, 0x0C, 0x42, 0x6F, 0x75, 0x67, 0x61, +0x69, 0x6E, 0x76, 0x69, 0x6C, 0x6C, 0x65, + /* Pacific/Chatham */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4E, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, @@ -17116,19 +17132,19 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { 0x36, 0x3B, 0x17, 0xE0, 0x36, 0xD7, 0xFA, 0x60, 0x38, 0x24, 0x34, 0x60, 0x38, 0xB7, 0xDC, 0x60, 0x4B, 0x11, 0x2C, 0xE0, 0x4B, 0xAE, 0x0F, 0x60, 0x4C, 0xC2, 0xEA, 0x60, 0x4D, 0x72, 0x41, 0xE0, 0x4E, 0xA2, 0xCC, 0x60, 0x4F, 0x1A, 0xC4, 0xE0, 0x50, 0x82, 0xAE, 0x60, 0x50, 0xFA, 0xA6, 0xE0, -0x52, 0x6B, 0xCA, 0xE0, 0x52, 0xDA, 0x7A, 0xD0, 0x54, 0x4B, 0xAC, 0xE0, 0x54, 0xBA, 0x5C, 0xD0, -0x56, 0x2B, 0x8E, 0xE0, 0x56, 0xA3, 0x79, 0x50, 0x58, 0x0B, 0x70, 0xE0, 0x58, 0x83, 0x5B, 0x50, -0x59, 0xEB, 0x52, 0xE0, 0x5A, 0x63, 0x3D, 0x50, 0x5B, 0xCB, 0x34, 0xE0, 0x5C, 0x43, 0x1F, 0x50, -0x5D, 0xB4, 0x51, 0x60, 0x5E, 0x23, 0x01, 0x50, 0x5F, 0x94, 0x33, 0x60, 0x60, 0x0C, 0x1D, 0xD0, -0x61, 0x74, 0x15, 0x60, 0x61, 0xEB, 0xFF, 0xD0, 0x63, 0x53, 0xF7, 0x60, 0x63, 0xCB, 0xE1, 0xD0, -0x65, 0x33, 0xD9, 0x60, 0x65, 0xAB, 0xC3, 0xD0, 0x67, 0x1C, 0xF5, 0xE0, 0x67, 0x8B, 0xA5, 0xD0, -0x68, 0xFC, 0xD7, 0xE0, 0x69, 0x6B, 0x87, 0xD0, 0x6A, 0xDC, 0xB9, 0xE0, 0x6B, 0x54, 0xA4, 0x50, -0x6C, 0xBC, 0x9B, 0xE0, 0x6D, 0x34, 0x86, 0x50, 0x6E, 0x9C, 0x7D, 0xE0, 0x6F, 0x14, 0x68, 0x50, -0x70, 0x7C, 0x5F, 0xE0, 0x70, 0xF4, 0x4A, 0x50, 0x72, 0x65, 0x7C, 0x60, 0x72, 0xD4, 0x2C, 0x50, -0x74, 0x45, 0x5E, 0x60, 0x74, 0xB4, 0x0E, 0x50, 0x76, 0x25, 0x40, 0x60, 0x76, 0x9D, 0x2A, 0xD0, -0x78, 0x05, 0x22, 0x60, 0x78, 0x7D, 0x0C, 0xD0, 0x79, 0xE5, 0x04, 0x60, 0x7A, 0x5C, 0xEE, 0xD0, -0x7B, 0xC4, 0xE6, 0x60, 0x7C, 0x3C, 0xD0, 0xD0, 0x7D, 0xAE, 0x02, 0xE0, 0x7E, 0x1C, 0xB2, 0xD0, -0x7F, 0x8D, 0xE4, 0xE0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x52, 0x6B, 0xCA, 0xE0, 0x52, 0xDA, 0x7A, 0xD0, 0x54, 0x54, 0xE7, 0x60, 0x54, 0xBA, 0x6A, 0xE0, +0x56, 0x34, 0xC9, 0x60, 0x56, 0xA3, 0x87, 0x60, 0x58, 0x1D, 0xE5, 0xE0, 0x58, 0x83, 0x69, 0x60, +0x59, 0xFD, 0xC7, 0xE0, 0x5A, 0x63, 0x4B, 0x60, 0x5B, 0xDD, 0xA9, 0xE0, 0x5C, 0x43, 0x2D, 0x60, +0x5D, 0xBD, 0x8B, 0xE0, 0x5E, 0x23, 0x0F, 0x60, 0x5F, 0x9D, 0x6D, 0xE0, 0x60, 0x0C, 0x2B, 0xE0, +0x61, 0x86, 0x8A, 0x60, 0x61, 0xEC, 0x0D, 0xE0, 0x63, 0x66, 0x6C, 0x60, 0x63, 0xCB, 0xEF, 0xE0, +0x65, 0x46, 0x4E, 0x60, 0x65, 0xAB, 0xD1, 0xE0, 0x67, 0x26, 0x30, 0x60, 0x67, 0x8B, 0xB3, 0xE0, +0x69, 0x06, 0x12, 0x60, 0x69, 0x6B, 0x95, 0xE0, 0x6A, 0xE5, 0xF4, 0x60, 0x6B, 0x54, 0xB2, 0x60, +0x6C, 0xCF, 0x10, 0xE0, 0x6D, 0x34, 0x94, 0x60, 0x6E, 0xAE, 0xF2, 0xE0, 0x6F, 0x14, 0x76, 0x60, +0x70, 0x8E, 0xD4, 0xE0, 0x70, 0xF4, 0x58, 0x60, 0x72, 0x6E, 0xB6, 0xE0, 0x72, 0xD4, 0x3A, 0x60, +0x74, 0x4E, 0x98, 0xE0, 0x74, 0xB4, 0x1C, 0x60, 0x76, 0x37, 0xB5, 0x60, 0x76, 0x9D, 0x38, 0xE0, +0x78, 0x17, 0x97, 0x60, 0x78, 0x7D, 0x1A, 0xE0, 0x79, 0xF7, 0x79, 0x60, 0x7A, 0x5C, 0xFC, 0xE0, +0x7B, 0xD7, 0x5B, 0x60, 0x7C, 0x3C, 0xDE, 0xE0, 0x7D, 0xB7, 0x3D, 0x60, 0x7E, 0x1C, 0xC0, 0xE0, +0x7F, 0x97, 0x1F, 0x60, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, @@ -17336,7 +17352,8 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x50, 0x47, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7A, 0xD5, 0x50, 0x01, 0xF3, 0x37, 0x7A, -0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x0E, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, +0x6E, 0x73, /* Pacific/Rarotonga */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -18530,4 +18547,4 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = { 0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, }; -const timelib_tzdb timezonedb_builtin = { "2014.7", 582, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; +const timelib_tzdb timezonedb_builtin = { "2014.9", 583, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 360c6d3f67..6146dec927 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -325,12 +325,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_name_from_abbr, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_offset_get, 0, 0, 2) - ZEND_ARG_INFO(0, object) - ZEND_ARG_INFO(0, datetime) + ZEND_ARG_OBJ_INFO(0, object, DateTimeZone, 0) + ZEND_ARG_OBJ_INFO(0, datetime, DateTimeInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_method_offset_get, 0, 0, 1) - ZEND_ARG_INFO(0, datetime) + ZEND_ARG_INFO(0, object) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_transitions_get, 0, 0, 1) @@ -1230,7 +1230,7 @@ static void php_date(INTERNAL_FUNCTION_PARAMETERS, int localtime) } /* }}} */ -PHPAPI zend_string *php_format_date(char *format, int 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 TSRMLS_DC) /* {{{ */ { timelib_time *t; timelib_tzinfo *tzi; @@ -3031,7 +3031,7 @@ PHP_FUNCTION(date_format) } /* }}} */ -static int php_date_modify(zval *object, char *modify, int modify_len TSRMLS_DC) /* {{{ */ +static int php_date_modify(zval *object, char *modify, size_t modify_len TSRMLS_DC) /* {{{ */ { php_date_obj *dateobj; timelib_time *tmp_time; @@ -3799,7 +3799,7 @@ PHP_FUNCTION(timezone_name_from_abbr) } /* }}} */ -/* {{{ proto long timezone_offset_get(DateTimeZone object, DateTime object) +/* {{{ proto long timezone_offset_get(DateTimeZone object, DateTimeInterface datetime) Returns the timezone offset. */ PHP_FUNCTION(timezone_offset_get) @@ -3809,13 +3809,13 @@ 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_date) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_timezone, &dateobject, date_ce_interface) == FAILURE) { RETURN_FALSE; } tzobj = Z_PHPTIMEZONE_P(object); DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone); dateobj = Z_PHPDATE_P(dateobject); - DATE_CHECK_INITIALIZED(dateobj->time, DateTime); + DATE_CHECK_INITIALIZED(dateobj->time, DateTimeInterface); switch (tzobj->type) { case TIMELIB_ZONETYPE_ID: @@ -3938,7 +3938,7 @@ PHP_FUNCTION(timezone_location_get) } /* }}} */ -static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *format, int format_length TSRMLS_DC) /* {{{ */ +static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *format, size_t format_length TSRMLS_DC) /* {{{ */ { timelib_time *b = NULL, *e = NULL; timelib_rel_time *p = NULL; @@ -4221,7 +4221,7 @@ PHP_FUNCTION(date_interval_create_from_date_string) /* }}} */ /* {{{ date_interval_format - */ -static zend_string *date_interval_format(char *format, int format_len, timelib_rel_time *t TSRMLS_DC) +static zend_string *date_interval_format(char *format, size_t format_len, timelib_rel_time *t TSRMLS_DC) { smart_str string = {0}; int i, length, have_format_spec = 0; @@ -4302,7 +4302,7 @@ PHP_FUNCTION(date_interval_format) } /* }}} */ -static int date_period_initialize(timelib_time **st, timelib_time **et, timelib_rel_time **d, zend_long *recurrences, /*const*/ char *format, int 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 TSRMLS_DC) /* {{{ */ { timelib_time *b = NULL, *e = NULL; timelib_rel_time *p = NULL; diff --git a/ext/date/php_date.h b/ext/date/php_date.h index aa46aa1b6c..ebbf9a9027 100644 --- a/ext/date/php_date.h +++ b/ext/date/php_date.h @@ -210,7 +210,7 @@ PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC); #define _php_strftime php_strftime PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm); #endif -PHPAPI zend_string *php_format_date(char *format, int 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 TSRMLS_DC); /* Mechanism to set new TZ database */ PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb); diff --git a/ext/date/tests/014.phpt b/ext/date/tests/014.phpt index 3adb32c965..1580f1ae70 100644 --- a/ext/date/tests/014.phpt +++ b/ext/date/tests/014.phpt @@ -37,6 +37,4 @@ Warning: timezone_offset_get() expects exactly 2 parameters, 0 given in %s on li bool(false) int(0) -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, object given in %s on line %d -bool(false) -Done +Catchable fatal error: Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, instance of DateTime given in %s diff --git a/ext/date/tests/68062.phpt b/ext/date/tests/68062.phpt new file mode 100644 index 0000000000..ce2105abae --- /dev/null +++ b/ext/date/tests/68062.phpt @@ -0,0 +1,13 @@ +--TEST-- +DateTimeZone::getOffset() accepts a DateTimeInterface object +--FILE-- +<?php + +$tz = new DateTimeZone('Europe/London'); +$dt = new DateTimeImmutable('2014-09-20', $tz); + +echo $tz->getOffset($dt); +echo $tz->getOffset(1); +--EXPECTF-- +3600 +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s diff --git a/ext/date/tests/DateTimeZone_getOffset_variation1.phpt b/ext/date/tests/DateTimeZone_getOffset_variation1.phpt index a86d5e10bb..ecd99d5bc3 100644 --- a/ext/date/tests/DateTimeZone_getOffset_variation1.phpt +++ b/ext/date/tests/DateTimeZone_getOffset_variation1.phpt @@ -112,141 +112,141 @@ fclose( $file_handle ); -- int 0 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d bool(false) -- int 1 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d bool(false) -- int 12345 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d bool(false) -- int -12345 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d bool(false) -- float 10.5 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, double given in %s on line %d bool(false) -- float -10.5 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, double given in %s on line %d bool(false) -- float .5 -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, double given in %s on line %d bool(false) -- empty array -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d bool(false) -- int indexed array -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d bool(false) -- associative array -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d bool(false) -- nested arrays -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d bool(false) -- uppercase NULL -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d bool(false) -- lowercase null -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d bool(false) -- lowercase true -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- lowercase false -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- uppercase TRUE -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- uppercase FALSE -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d bool(false) -- empty string DQ -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- empty string SQ -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- string DQ -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- string SQ -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- mixed case string -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- heredoc -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d bool(false) -- instance of classWithToString -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, object given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, object given in %s on line %d bool(false) -- instance of classWithoutToString -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, object given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, object given in %s on line %d bool(false) -- undefined var -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d bool(false) -- unset var -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d bool(false) -- resource -- -Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, resource given in %s on line %d +Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, resource given in %s on line %d bool(false) ===DONE=== diff --git a/ext/date/tests/bug67118.phpt b/ext/date/tests/bug67118.phpt index 19b5914aa3..4884d77bac 100644 --- a/ext/date/tests/bug67118.phpt +++ b/ext/date/tests/bug67118.phpt @@ -23,4 +23,7 @@ class mydt extends datetime new mydt("Funktionsansvarig rådgivning och juridik", "UTC"); ?> --EXPECTF-- -Fatal error: Call to a member function format() on null in %sbug67118.php on line %d + +Warning: DateTime::format(): The DateTime object has not been correctly initialized by its constructor in %s on line %d +Bad date + diff --git a/ext/date/tests/bug67118_2.phpt b/ext/date/tests/bug67118_2.phpt index 368d4d9401..9b6f545525 100644 --- a/ext/date/tests/bug67118_2.phpt +++ b/ext/date/tests/bug67118_2.phpt @@ -24,5 +24,12 @@ Done --EXPECTF-- First try Second try -NULL -Done
\ No newline at end of file +object(Foo)#1 (3) { + ["date"]=> + string(26) "2007-09-12 15:49:12.000000" + ["timezone_type"]=> + int(3) + ["timezone"]=> + string(3) "UTC" +} +Done diff --git a/ext/date/tests/timezone_offset_get_error.phpt b/ext/date/tests/timezone_offset_get_error.phpt index b8ca2c1c15..9e9daacf84 100644 --- a/ext/date/tests/timezone_offset_get_error.phpt +++ b/ext/date/tests/timezone_offset_get_error.phpt @@ -1,5 +1,5 @@ --TEST-- -Test timezone_offset_get() function : error conditions +Test timezone_offset_get() function : error conditions --FILE-- <?php /* Prototype : int timezone_offset_get ( DateTimeZone $object , DateTime $datetime ) @@ -7,12 +7,20 @@ Test timezone_offset_get() function : error conditions * Source code: ext/date/php_date.c * Alias to functions: DateTimeZone::getOffset */ - -//Set the default time zone + +//Set the default time zone date_default_timezone_set("GMT"); $tz = timezone_open("Europe/London"); $date = date_create("GMT"); - + +set_error_handler('err'); + +function err($errno, $errstr) { + if ($errno === E_RECOVERABLE_ERROR) { + var_dump($errstr); + } +} + echo "*** Testing timezone_offset_get() : error conditions ***\n"; echo "\n-- Testing timezone_offset_get() function with zero arguments --\n"; @@ -27,7 +35,7 @@ var_dump( timezone_offset_get($tz, $date, $extra_arg) ); echo "\n-- Testing timezone_offset_get() function with an invalid values for \$object argument --\n"; $invalid_obj = new stdClass(); -var_dump( timezone_offset_get($invalid_obj, $date) ); +var_dump( timezone_offset_get($invalid_obj, $date) ); $invalid_obj = 10; var_dump( timezone_offset_get($invalid_obj, $date) ); $invalid_obj = null; @@ -35,50 +43,38 @@ var_dump( timezone_offset_get($invalid_obj, $date) ); echo "\n-- Testing timezone_offset_get() function with an invalid values for \$datetime argument --\n"; $invalid_obj = new stdClass(); -var_dump( timezone_offset_get($tz, $invalid_obj) ); +var_dump( timezone_offset_get($tz, $invalid_obj) ); $invalid_obj = 10; var_dump( timezone_offset_get($tz, $invalid_obj) ); $invalid_obj = null; -var_dump( timezone_offset_get($tz, $invalid_obj) ); +var_dump( timezone_offset_get($tz, $invalid_obj) ); ?> ===DONE=== --EXPECTF-- *** Testing timezone_offset_get() : error conditions *** -- Testing timezone_offset_get() function with zero arguments -- - -Warning: timezone_offset_get() expects exactly 2 parameters, 0 given in %s on line %d bool(false) -- Testing timezone_offset_get() function with less than expected no. of arguments -- - -Warning: timezone_offset_get() expects exactly 2 parameters, 1 given in %s on line %d bool(false) -- Testing timezone_offset_get() function with more than expected no. of arguments -- - -Warning: timezone_offset_get() expects exactly 2 parameters, 3 given in %s on line %d bool(false) -- Testing timezone_offset_get() function with an invalid values for $object argument -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, object given in %s on line %d +string(%d) "Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, instance of stdClass given" bool(false) - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, integer given in %s on line %d +string(%d) "Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, integer given" bool(false) - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, null given in %s on line %d +string(%d) "Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, null given" bool(false) -- Testing timezone_offset_get() function with an invalid values for $datetime argument -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, object given in %s on line %d +string(%d) "Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, instance of stdClass given" bool(false) - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d +string(%d) "Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, integer given" bool(false) - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d +string(%d) "Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, null given" bool(false) ===DONE=== diff --git a/ext/date/tests/timezone_offset_get_variation1.phpt b/ext/date/tests/timezone_offset_get_variation1.phpt index 5fd5e8b270..01013ab5cd 100644 --- a/ext/date/tests/timezone_offset_get_variation1.phpt +++ b/ext/date/tests/timezone_offset_get_variation1.phpt @@ -13,6 +13,14 @@ echo "*** Testing timezone_offset_get() : usage variation - unexpected values t //Set the default time zone date_default_timezone_set("Europe/London"); +set_error_handler('handler'); + +function handler($errno, $errstr) { + if ($errno === E_RECOVERABLE_ERROR) { + echo $errstr . "\n"; + } +} + //get an unset variable $unset_var = 10; unset ($unset_var); @@ -111,142 +119,114 @@ fclose( $file_handle ); *** Testing timezone_offset_get() : usage variation - unexpected values to first argument $object*** -- int 0 -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, integer given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, integer given bool(false) -- int 1 -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, integer given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, integer given bool(false) -- int 12345 -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, integer given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, integer given bool(false) -- int -12345 -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, integer given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, integer given bool(false) -- float 10.5 -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, double given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, double given bool(false) -- float -10.5 -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, double given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, double given bool(false) -- float .5 -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, double given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, double given bool(false) -- empty array -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, array given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, array given bool(false) -- int indexed array -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, array given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, array given bool(false) -- associative array -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, array given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, array given bool(false) -- nested arrays -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, array given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, array given bool(false) -- uppercase NULL -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, null given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, null given bool(false) -- lowercase null -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, null given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, null given bool(false) -- lowercase true -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, boolean given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, boolean given bool(false) -- lowercase false -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, boolean given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, boolean given bool(false) -- uppercase TRUE -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, boolean given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, boolean given bool(false) -- uppercase FALSE -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, boolean given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, boolean given bool(false) -- empty string DQ -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, string given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, string given bool(false) -- empty string SQ -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, string given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, string given bool(false) -- string DQ -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, string given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, string given bool(false) -- string SQ -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, string given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, string given bool(false) -- mixed case string -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, string given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, string given bool(false) -- heredoc -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, string given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, string given bool(false) -- instance of classWithToString -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, object given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, instance of classWithToString given bool(false) -- instance of classWithoutToString -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, object given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, instance of classWithoutToString given bool(false) -- undefined var -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, null given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, null given bool(false) -- unset var -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, null given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, null given bool(false) -- resource -- - -Warning: timezone_offset_get() expects parameter 1 to be DateTimeZone, resource given in %s on line %d +Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, resource given bool(false) ===DONE=== diff --git a/ext/date/tests/timezone_offset_get_variation2.phpt b/ext/date/tests/timezone_offset_get_variation2.phpt index 93311f3a6b..98e1093514 100644 --- a/ext/date/tests/timezone_offset_get_variation2.phpt +++ b/ext/date/tests/timezone_offset_get_variation2.phpt @@ -13,6 +13,14 @@ echo "*** Testing timezone_offset_get() : usage variation - unexpected values t //Set the default time zone date_default_timezone_set("Europe/London"); +set_error_handler('handler'); + +function handler($errno, $errstr) { + if ($errno === E_RECOVERABLE_ERROR) { + echo $errstr . "\n"; + } +} + //get an unset variable $unset_var = 10; unset ($unset_var); @@ -111,142 +119,114 @@ fclose( $file_handle ); *** Testing timezone_offset_get() : usage variation - unexpected values to second argument $datetime*** -- int 0 -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, integer given bool(false) -- int 1 -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, integer given bool(false) -- int 12345 -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, integer given bool(false) -- int -12345 -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, integer given bool(false) -- float 10.5 -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, double given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, double given bool(false) -- float -10.5 -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, double given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, double given bool(false) -- float .5 -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, double given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, double given bool(false) -- empty array -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, array given bool(false) -- int indexed array -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, array given bool(false) -- associative array -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, array given bool(false) -- nested arrays -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, array given bool(false) -- uppercase NULL -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, null given bool(false) -- lowercase null -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, null given bool(false) -- lowercase true -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, boolean given bool(false) -- lowercase false -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, boolean given bool(false) -- uppercase TRUE -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, boolean given bool(false) -- uppercase FALSE -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, boolean given bool(false) -- empty string DQ -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, string given bool(false) -- empty string SQ -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, string given bool(false) -- string DQ -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, string given bool(false) -- string SQ -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, string given bool(false) -- mixed case string -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, string given bool(false) -- heredoc -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, string given bool(false) -- instance of classWithToString -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, object given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, instance of classWithToString given bool(false) -- instance of classWithoutToString -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, object given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, instance of classWithoutToString given bool(false) -- undefined var -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, null given bool(false) -- unset var -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, null given bool(false) -- resource -- - -Warning: timezone_offset_get() expects parameter 2 to be DateTime, resource given in %s on line %d +Argument 2 passed to timezone_offset_get() must implement interface DateTimeInterface, resource given bool(false) ===DONE=== diff --git a/ext/dba/dba.dsp b/ext/dba/dba.dsp deleted file mode 100644 index 548ecf8637..0000000000 --- a/ext/dba/dba.dsp +++ /dev/null @@ -1,213 +0,0 @@ -# Microsoft Developer Studio Project File - Name="dba" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=dba - Win32 Debug_TS Berkeley DB3
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "dba.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "dba.mak" CFG="dba - Win32 Debug_TS Berkeley DB3"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "dba - Win32 Release_TS Berkeley DB3" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "dba - Win32 Debug_TS Berkeley DB3" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "dba - Win32 Release_TS Berkeley DB3"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D DBA_DB3=1 /D DB3_INCLUDE_FILE="db.h" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D DBA_DB3=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D DBA_FLATFILE=1 /D DBA_CDB=1 /D DBA_CDB_MAKE=1 /D DBA_CDB_BUILTIN=1 /D DBA_INIFILE=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php7ts.lib libdb31s.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_dba.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-# ADD LINK32 php7ts.lib libdb31s.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_dba.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "dba - Win32 Debug_TS Berkeley DB3"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D "DBA_DB3" /D DB3_INCLUDE_FILE="db.h" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "DBA_DB3" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_DBA" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DBA=1 /D DBA_FLATFILE=1 /D DBA_CDB=1 /D DBA_CDB_MAKE=1 /D DBA_CDB_BUILTIN=1 /D DBA_INIFILE=1 /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php7ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_dba.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-# ADD LINK32 php7ts_debug.lib libdb31s.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_dba.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "dba - Win32 Release_TS Berkeley DB3"
-# Name "dba - Win32 Debug_TS Berkeley DB3"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\libcdb\cdb.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libcdb\cdb_make.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dba.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dba_cdb.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dba_db2.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dba_db3.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dba_dbm.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dba_flatfile.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dba_gdbm.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dba_inifile.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dba_ndbm.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libflatfile\flatfile.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libinifile\inifile.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libcdb\uint32.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\libcdb\cdb.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libcdb\cdb_make.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libflatfile\flatfile.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_cdb.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_db2.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_db3.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_dba.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_dbm.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_flatfile.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_gdbm.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_inifile.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_ndbm.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libcdb\uint32.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libinifile\inifile.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/dom/dom.dsp b/ext/dom/dom.dsp deleted file mode 100644 index cc507e5317..0000000000 --- a/ext/dom/dom.dsp +++ /dev/null @@ -1,250 +0,0 @@ -# Microsoft Developer Studio Project File - Name="dom" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=dom - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "dom.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "dom.mak" CFG="dom - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "dom - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "dom - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "dom - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_DOM" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DOM_EXPORTS" /D "COMPILE_DL_DOM" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DOM=1 /D "LIBXML_THREAD_ENABLED" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib /nologo /dll /machine:I386
-# ADD LINK32 wsock32.lib php7ts.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /machine:I386 /out:"..\..\Release_TS/php_dom.dll" /implib:"..\..\Release_TS/php_dom.lib" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\bindlib_w32\Release"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF "$(CFG)" == "dom - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "mssql-70" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_DOM" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "DOM_EXPORTS" /D "COMPILE_DL_DOM" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_DOM=1 /D LIBXML_THREAD_ENABLED=1 /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib /nologo /dll /machine:I386
-# ADD LINK32 php7ts_debug.lib ws2_32.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS\php_dom.dll" /implib:"..\..\Debug_TS/php_dom.lib" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release"
-
-!ENDIF
-
-# Begin Target
-
-# Name "dom - Win32 Release_TS"
-# Name "dom - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\attr.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\cdatasection.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\characterdata.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\comment.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\document.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\documentfragment.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\documenttype.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\domconfiguration.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\domerror.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\domerrorhandler.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\domexception.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\domimplementation.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\domimplementationlist.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\domimplementationsource.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\domlocator.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\domstringlist.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\element.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\entity.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\entityreference.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\namednodemap.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\namelist.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\node.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\nodelist.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\notation.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_dom.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\processinginstruction.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\string_extend.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\text.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\typeinfo.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\userdatahandler.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\xpath.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\dom_ce.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\dom_fe.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\dom_properties.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_dom.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\xml_common.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/dom/dom_properties.h b/ext/dom/dom_properties.h index 7e607f0a2e..b5c81d271b 100644 --- a/ext/dom/dom_properties.h +++ b/ext/dom/dom_properties.h @@ -137,6 +137,8 @@ int dom_node_text_content_write(dom_object *obj, zval *newval TSRMLS_DC); /* nodelist properties */ int dom_nodelist_length_read(dom_object *obj, zval *retval TSRMLS_DC); +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); diff --git a/ext/dom/nodelist.c b/ext/dom/nodelist.c index 68292d1983..15071739d2 100644 --- a/ext/dom/nodelist.c +++ b/ext/dom/nodelist.c @@ -153,8 +153,7 @@ PHP_FUNCTION(dom_nodelist_item) } else { nodep = nodep->children; } - itemnode = dom_get_elements_by_tag_name_ns_raw( - nodep, (char *) objmap->ns, (char *) objmap->local, &count, index); + itemnode = dom_get_elements_by_tag_name_ns_raw(nodep, objmap->ns, objmap->local, &count, index); } } } diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index 8a00ad5a08..c25cbaba58 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -619,6 +619,8 @@ PHP_MINIT_FUNCTION(dom) memcpy(&dom_nnodemap_object_handlers, &dom_object_handlers, sizeof(zend_object_handlers)); dom_nnodemap_object_handlers.free_obj = dom_nnodemap_objects_free_storage; dom_nnodemap_object_handlers.dtor_obj = dom_nnodemap_object_dtor; + dom_nnodemap_object_handlers.read_dimension = dom_nodelist_read_dimension; + dom_nnodemap_object_handlers.has_dimension = dom_nodelist_has_dimension; zend_hash_init(&classes, 0, NULL, NULL, 1); @@ -1542,6 +1544,34 @@ 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 offset_copy; + + if (!offset) { + return NULL; + } + + ZVAL_LONG(&offset_copy, zval_get_long(offset)); + + zend_call_method_with_1_params(object, Z_OBJCE_P(object), NULL, "item", rv, &offset_copy); + + return rv; +} /* }}} end dom_nodelist_read_dimension */ + +int dom_nodelist_has_dimension(zval *object, zval *member, int check_empty TSRMLS_DC) +{ + 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); + + return length && offset < Z_LVAL_P(length); + } +} /* }}} end dom_nodelist_has_dimension */ + #endif /* HAVE_DOM */ /* diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h index 9162031a90..02eb2d9509 100644 --- a/ext/dom/php_dom.h +++ b/ext/dom/php_dom.h @@ -126,6 +126,8 @@ 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); #define REGISTER_DOM_CLASS(ce, name, parent_ce, funcs, entry) \ INIT_CLASS_ENTRY(ce, name, funcs); \ diff --git a/ext/dom/tests/bug67949.phpt b/ext/dom/tests/bug67949.phpt new file mode 100644 index 0000000000..e4eb6f724f --- /dev/null +++ b/ext/dom/tests/bug67949.phpt @@ -0,0 +1,87 @@ +--TEST-- +Bug #67949: DOMNodeList elements should be accessible through array notation +--FILE-- +<?php + +$html = <<<HTML +<div>data</div> +<a href="test">hello world</a> +HTML; +$doc = new DOMDocument; +$doc->loadHTML($html); + +$nodes = $doc->getElementsByTagName('div'); + +echo "testing has_dimension\n"; +var_dump(isset($nodes[0])); +var_dump(isset($nodes[1])); +var_dump(isset($nodes[-1])); + +echo "testing property access\n"; +var_dump($nodes[0]->textContent); +var_dump($nodes[1]->textContent); + +echo "testing offset not a long\n"; +$offset = ['test']; +var_dump($offset); +var_dump(isset($nodes[$offset]), $nodes[$offset]->textContent); +var_dump($offset); + +$something = 'test'; +$offset = &$something; + +var_dump($offset); +var_dump(isset($nodes[$offset]), $nodes[$offset]->textContent); +var_dump($offset); + +$offset = 'test'; +var_dump($offset); +var_dump(isset($nodes[$offset]), $nodes[$offset]->textContent); +var_dump($offset); + +echo "testing read_dimension with null offset\n"; +var_dump($nodes[][] = 1); + +echo "testing attribute access\n"; +$anchor = $doc->getElementsByTagName('a')[0]; +var_dump($anchor->attributes[0]->name); + +echo "==DONE==\n"; + +--EXPECTF-- +testing has_dimension +bool(true) +bool(false) +bool(false) +testing property access +string(4) "data" + +Notice: Trying to get property of non-object in %s on line %d +NULL +testing offset not a long +array(1) { + [0]=> + string(4) "test" +} + +Notice: Trying to get property of non-object in %s on line %d +bool(false) +NULL +array(1) { + [0]=> + string(4) "test" +} +string(4) "test" +bool(true) +string(4) "data" +string(4) "test" +string(4) "test" +bool(true) +string(4) "data" +string(4) "test" +testing read_dimension with null offset +NULL +testing attribute access +string(4) "href" +==DONE== + diff --git a/ext/ereg/regex/regex.dsp b/ext/ereg/regex/regex.dsp deleted file mode 100644 index e8f1ad4299..0000000000 --- a/ext/ereg/regex/regex.dsp +++ /dev/null @@ -1,106 +0,0 @@ -# Microsoft Developer Studio Project File - Name="regex" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=regex - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "regex.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "regex.mak" CFG="regex - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "regex - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "regex - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "regex - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 - -!ELSEIF "$(CFG)" == "regex - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "regex - Win32 Release" -# Name "regex - Win32 Debug" -# Begin Source File - -SOURCE=.\regcomp.c -# End Source File -# Begin Source File - -SOURCE=.\regerror.c -# End Source File -# Begin Source File - -SOURCE=.\regexec.c -# End Source File -# Begin Source File - -SOURCE=.\regfree.c -# End Source File -# End Target -# End Project diff --git a/ext/ereg/regex/regex.dsw b/ext/ereg/regex/regex.dsw deleted file mode 100644 index 7b7df8126c..0000000000 --- a/ext/ereg/regex/regex.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 5.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "regex"=.\regex.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 42f8a24102..06e1dae41a 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -2413,11 +2413,11 @@ static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel data_ptr += 8; break; case TAG_FMT_SINGLE: - memmove(data_ptr, &info_data->value.f, byte_count); + memmove(data_ptr, &info_value->f, 4); data_ptr += 4; break; case TAG_FMT_DOUBLE: - memmove(data_ptr, &info_data->value.d, byte_count); + memmove(data_ptr, &info_value->d, 8); data_ptr += 8; break; } diff --git a/ext/exif/exif.dsp b/ext/exif/exif.dsp deleted file mode 100644 index c5b26b42d0..0000000000 --- a/ext/exif/exif.dsp +++ /dev/null @@ -1,113 +0,0 @@ -# Microsoft Developer Studio Project File - Name="exif" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=exif - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "exif.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "exif.mak" CFG="exif - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "exif - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "exif - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "exif - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_EXIF" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXIF_EXPORTS" /D "COMPILE_DL_EXIF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXIF=1 /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_exif.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "exif - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_EXIF" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXIF_EXPORTS" /D "COMPILE_DL_EXIF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXIF=1 /D "LIBZEND_EXPORTS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts_debug.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_exif.dll" /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "exif - Win32 Release_TS"
-# Name "exif - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\exif.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_exif.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/exif/tests/bug68113.jpg b/ext/exif/tests/bug68113.jpg Binary files differnew file mode 100755 index 0000000000..3ce7a620fb --- /dev/null +++ b/ext/exif/tests/bug68113.jpg diff --git a/ext/exif/tests/bug68113.phpt b/ext/exif/tests/bug68113.phpt new file mode 100644 index 0000000000..0fa4c4aca8 --- /dev/null +++ b/ext/exif/tests/bug68113.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #68113 (Heap corruption in exif_thumbnail()) +--SKIPIF-- +<?php +extension_loaded("exif") or die("skip need exif"); +?> +--FILE-- +<?php +var_dump(exif_thumbnail(__DIR__."/bug68113.jpg")); +?> +Done +--EXPECTF-- +Warning: exif_thumbnail(bug68113.jpg): File structure corrupted in %s/bug68113.php on line 2 + +Warning: exif_thumbnail(bug68113.jpg): Invalid JPEG file in %s/bug68113.php on line 2 +bool(false) +Done
\ No newline at end of file diff --git a/ext/ext_skel b/ext/ext_skel index e6b01fd4fc..c0c398d15e 100755 --- a/ext/ext_skel +++ b/ext/ext_skel @@ -156,12 +156,12 @@ if test "\$PHP_$EXTNAME" != "no"; then dnl PHP_CHECK_LIBRARY(\$LIBNAME,\$LIBSYMBOL, dnl [ - dnl PHP_ADD_LIBRARY_WITH_PATH(\$LIBNAME, \$${EXTNAME}_DIR/lib, ${EXTNAME}_SHARED_LIBADD) + dnl PHP_ADD_LIBRARY_WITH_PATH(\$LIBNAME, \$${EXTNAME}_DIR/\$PHP_LIBDIR, ${EXTNAME}_SHARED_LIBADD) dnl AC_DEFINE(HAVE_${EXTNAME}LIB,1,[ ]) dnl ],[ dnl AC_MSG_ERROR([wrong $extname lib version or lib not found]) dnl ],[ - dnl -L\$${EXTNAME}_DIR/lib -lm + dnl -L\$${EXTNAME}_DIR/\$PHP_LIBDIR -lm dnl ]) dnl dnl PHP_SUBST(${EXTNAME}_SHARED_LIBADD) diff --git a/ext/ext_skel_win32.php b/ext/ext_skel_win32.php index c04f037657..770c6f48bb 100644 --- a/ext/ext_skel_win32.php +++ b/ext/ext_skel_win32.php @@ -35,20 +35,6 @@ foreach($argv as $arg) { } } -$fp = fopen("$skel/skeleton.dsp", "rb"); -if ($fp) { - $dsp_file = fread($fp, filesize("$skel/skeleton.dsp")); - fclose($fp); - - $dsp_file = str_replace("extname", $extname, $dsp_file); - $dsp_file = str_replace("EXTNAME", strtoupper($extname), $dsp_file); - $fp = fopen("$extname/$extname.dsp", "wb"); - if ($fp) { - fwrite($fp, $dsp_file); - fclose($fp); - } -} - $fp = fopen("$extname/$extname.php", "rb"); if ($fp) { $php_file = fread($fp, filesize("$extname/$extname.php")); @@ -62,4 +48,5 @@ if ($fp) { } } -?>
\ No newline at end of file +?> + diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c index f365b38573..6879926eca 100644 --- a/ext/fileinfo/fileinfo.c +++ b/ext/fileinfo/fileinfo.c @@ -57,7 +57,7 @@ typedef struct _finfo_object { } finfo_object; #define FILEINFO_DECLARE_INIT_OBJECT(object) \ - zval *object = getThis(); + zval *object = ZEND_IS_METHOD_CALL() ? getThis() : NULL; static inline finfo_object *php_finfo_fetch_object(zend_object *obj) { return (finfo_object *)((char*)(obj) - XtOffsetOf(finfo_object, zo)); diff --git a/ext/fileinfo/libmagic.patch b/ext/fileinfo/libmagic.patch index 8b0b9a8911..30f1e9b450 100644 --- a/ext/fileinfo/libmagic.patch +++ b/ext/fileinfo/libmagic.patch @@ -1,6 +1,6 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c --- libmagic.orig/apprentice.c Tue Nov 19 22:01:12 2013 -+++ libmagic/apprentice.c Mon Mar 31 17:15:53 2014 ++++ libmagic/apprentice.c Sun Sep 21 18:30:39 2014 @@ -29,6 +29,8 @@ * apprentice - make one pass through /etc/magic, learning its secrets. */ @@ -357,8 +357,9 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c uint32_t i, j; size_t files = 0, maxfiles = 0; - char **filearr = NULL, *mfn; +- struct stat st; + char **filearr = NULL; - struct stat st; ++ zend_stat_t st; struct magic_map *map; struct magic_entry_set mset[MAGIC_SETS]; - DIR *dir; @@ -406,8 +407,9 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c + php_stream_closedir(dir); goto out; } - if (stat(mfn, &st) == -1 || !S_ISREG(st.st_mode)) { +- if (stat(mfn, &st) == -1 || !S_ISREG(st.st_mode)) { - free(mfn); ++ if (zend_stat(mfn, &st) == -1 || !S_ISREG(st.st_mode)) { continue; } if (files >= maxfiles) { @@ -454,6 +456,15 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c return NULL; } return map; +@@ -1248,7 +1272,7 @@ + * the sign extension must have happened. + */ + case FILE_BYTE: +- v = (char) v; ++ v = (signed char) v; + break; + case FILE_SHORT: + case FILE_BESHORT: @@ -1516,7 +1540,7 @@ if (me->cont_count == me->max_count) { struct magic *nm; @@ -536,12 +547,12 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c size_t i; + php_stream *stream = NULL; + php_stream_statbuf st; -+ -+ -+ TSRMLS_FETCH(); - 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); @@ -649,7 +660,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c + if (NULL != fn) { + nentries = (uint32_t)(st.sb.st_size / sizeof(struct magic)); + entries = (uint32_t)(st.sb.st_size / sizeof(struct magic)); -+ if ((off_t)(entries * sizeof(struct magic)) != st.sb.st_size) { ++ if ((zend_off_t)(entries * sizeof(struct magic)) != st.sb.st_size) { + file_error(ms, 0, "Size of `%s' %llu is not a multiple of %zu", + dbname, (unsigned long long)st.sb.st_size, + sizeof(struct magic)); @@ -729,7 +740,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c assert(nm + sizeof(ar) < m); - if (lseek(fd, (off_t)m, SEEK_SET) != (off_t)m) { -+ if (php_stream_seek(stream,(off_t)sizeof(struct magic), SEEK_SET) != sizeof(struct magic)) { ++ if (php_stream_seek(stream,(zend_off_t)sizeof(struct magic), SEEK_SET) != sizeof(struct magic)) { file_error(ms, errno, "error seeking `%s'", dbname); goto out; } @@ -800,7 +811,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c } diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c --- libmagic.orig/ascmagic.c Thu Feb 13 00:20:53 2014 -+++ libmagic/ascmagic.c Fri Feb 21 00:21:27 2014 ++++ libmagic/ascmagic.c Wed Aug 27 12:35:45 2014 @@ -139,7 +139,7 @@ /* malloc size is a conservative overestimate; could be improved, or at least realloced after conversion. */ @@ -822,7 +833,7 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c } diff -u libmagic.orig/cdf.c libmagic/cdf.c --- libmagic.orig/cdf.c Tue Feb 26 17:20:42 2013 -+++ libmagic/cdf.c Tue Jul 1 08:57:25 2014 ++++ libmagic/cdf.c Wed Aug 27 12:35:45 2014 @@ -35,7 +35,7 @@ #include "file.h" @@ -850,7 +861,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c #include <string.h> #include <time.h> #include <ctype.h> -@@ -267,13 +277,15 @@ +@@ -267,23 +277,25 @@ { const char *b = (const char *)sst->sst_tab; const char *e = ((const char *)p) + tail; @@ -868,18 +879,48 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c errno = EFTYPE; return -1; } + + static ssize_t +-cdf_read(const cdf_info_t *info, off_t off, void *buf, size_t len) ++cdf_read(const cdf_info_t *info, zend_off_t off, void *buf, size_t len) + { + size_t siz = (size_t)off + len; + +- if ((off_t)(off + len) != (off_t)siz) { ++ if ((zend_off_t)(off + len) != (zend_off_t)siz) { + errno = EINVAL; + return -1; + } @@ -296,7 +308,10 @@ if (info->i_fd == -1) return -1; - if (pread(info->i_fd, buf, len, off) != (ssize_t)len) -+ if (FINFO_LSEEK_FUNC(info->i_fd, off, SEEK_SET) == (off_t)-1) ++ if (FINFO_LSEEK_FUNC(info->i_fd, off, SEEK_SET) == (zend_off_t)-1) + return -1; + + if (FINFO_READ_FUNC(info->i_fd, buf, len) != (ssize_t)len) return -1; return (ssize_t)len; +@@ -308,7 +323,7 @@ + char buf[512]; + + (void)memcpy(cdf_bo.s, "\01\02\03\04", 4); +- if (cdf_read(info, (off_t)0, buf, sizeof(buf)) == -1) ++ if (cdf_read(info, (zend_off_t)0, buf, sizeof(buf)) == -1) + return -1; + cdf_unpack_header(h, buf); + cdf_swap_header(h); +@@ -342,7 +357,7 @@ + size_t ss = CDF_SEC_SIZE(h); + size_t pos = CDF_SEC_POS(h, id); + assert(ss == len); +- return cdf_read(info, (off_t)pos, ((char *)buf) + offs, len); ++ return cdf_read(info, (zend_off_t)pos, ((char *)buf) + offs, len); + } + + ssize_t @@ -352,10 +367,10 @@ size_t ss = CDF_SHORT_SEC_SIZE(h); size_t pos = CDF_SHORT_SEC_POS(h, id); @@ -937,7 +978,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c /* If the it is not there, just fake it; some docs don't have it */ if (d->d_stream_first_sector < 0) -@@ -796,7 +815,11 @@ +@@ -796,11 +815,15 @@ if (cdf_check_stream_offset(sst, h, e, 0, __LINE__) == -1) goto out; for (i = 0; i < sh.sh_properties; i++) { @@ -950,6 +991,11 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c q = (const uint8_t *)(const void *) ((const char *)(const void *)p + ofs - 2 * sizeof(uint32_t)); +- if (q > e) { ++ if (q < p || q > e) { + DPRINTF(("Ran of the end %p > %p\n", q, e)); + goto out; + } @@ -810,6 +833,10 @@ i, inp[i].pi_id, inp[i].pi_type, q - p, offs)); if (inp[i].pi_type & CDF_VECTOR) { @@ -1038,7 +1084,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c } else { diff -u libmagic.orig/cdf.h libmagic/cdf.h --- libmagic.orig/cdf.h Thu Jun 21 00:19:55 2012 -+++ libmagic/cdf.h Thu Jun 5 18:05:33 2014 ++++ libmagic/cdf.h Wed Aug 27 12:35:45 2014 @@ -35,10 +35,12 @@ #ifndef _H_CDF_ #define _H_CDF_ @@ -1091,7 +1137,7 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h int cdf_read_summary_info(const cdf_info_t *, const cdf_header_t *, diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c --- libmagic.orig/cdf_time.c Thu Jun 21 00:18:33 2012 -+++ libmagic/cdf_time.c Fri Feb 21 00:21:27 2014 ++++ libmagic/cdf_time.c Wed Aug 27 12:35:45 2014 @@ -96,7 +96,7 @@ } @@ -1151,7 +1197,7 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c static const char *ref = "Sat Apr 23 01:30:00 1977"; diff -u libmagic.orig/compress.c libmagic/compress.c --- libmagic.orig/compress.c Sun Jan 5 16:55:21 2014 -+++ libmagic/compress.c Fri Feb 21 00:21:27 2014 ++++ libmagic/compress.c Wed Aug 27 12:35:45 2014 @@ -32,6 +32,7 @@ * uncompress(method, old, n, newch) - uncompress old into new, * using method, return sizeof new @@ -1237,7 +1283,7 @@ diff -u libmagic.orig/compress.c libmagic/compress.c } (void)close(tfd); - if (lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1) { -+ if (FINFO_LSEEK_FUNC(fd, (off_t)0, SEEK_SET) == (off_t)-1) { ++ if (FINFO_LSEEK_FUNC(fd, (zend_off_t)0, SEEK_SET) == (zend_off_t)-1) { file_badseek(ms); return -1; } @@ -1266,7 +1312,7 @@ diff -u libmagic.orig/compress.c libmagic/compress.c - _exit(1); - (void) lseek(0, (off_t)0, SEEK_SET); + (void) dup(fd); -+ (void) FINFO_LSEEK_FUNC(0, (off_t)0, SEEK_SET); ++ (void) FINFO_LSEEK_FUNC(0, (zend_off_t)0, SEEK_SET); } else { - if (dup(fdin[0]) == -1) - _exit(1); @@ -1312,9 +1358,39 @@ diff -u libmagic.orig/compress.c libmagic/compress.c } -#endif +#endif /* if PHP_FILEINFO_UNCOMPRESS */ +diff -u libmagic.orig/elfclass.h libmagic/elfclass.h +--- libmagic.orig/elfclass.h Mon Feb 18 19:33:14 2013 ++++ libmagic/elfclass.h Wed Aug 27 12:35:45 2014 +@@ -37,7 +37,7 @@ + case ET_CORE: + flags |= FLAGS_IS_CORE; + if (dophn_core(ms, clazz, swap, fd, +- (off_t)elf_getu(swap, elfhdr.e_phoff), ++ (zend_off_t)elf_getu(swap, elfhdr.e_phoff), + elf_getu16(swap, elfhdr.e_phnum), + (size_t)elf_getu16(swap, elfhdr.e_phentsize), + fsize, &flags) == -1) +@@ -47,7 +47,7 @@ + case ET_EXEC: + case ET_DYN: + if (dophn_exec(ms, clazz, swap, fd, +- (off_t)elf_getu(swap, elfhdr.e_phoff), ++ (zend_off_t)elf_getu(swap, elfhdr.e_phoff), + elf_getu16(swap, elfhdr.e_phnum), + (size_t)elf_getu16(swap, elfhdr.e_phentsize), + fsize, &flags, elf_getu16(swap, elfhdr.e_shnum)) +@@ -56,7 +56,7 @@ + /*FALLTHROUGH*/ + case ET_REL: + if (doshn(ms, clazz, swap, fd, +- (off_t)elf_getu(swap, elfhdr.e_shoff), ++ (zend_off_t)elf_getu(swap, elfhdr.e_shoff), + elf_getu16(swap, elfhdr.e_shnum), + (size_t)elf_getu16(swap, elfhdr.e_shentsize), + fsize, &flags, elf_getu16(swap, elfhdr.e_machine), diff -u libmagic.orig/file.h libmagic/file.h --- libmagic.orig/file.h Thu Feb 13 00:20:53 2014 -+++ libmagic/file.h Fri Feb 21 00:21:27 2014 ++++ libmagic/file.h Wed Aug 27 12:35:45 2014 @@ -33,11 +33,9 @@ #ifndef __file_h__ #define __file_h__ @@ -1383,7 +1459,13 @@ diff -u libmagic.orig/file.h libmagic/file.h ((t) == FILE_STRING || \ (t) == FILE_PSTRING || \ (t) == FILE_BESTRING16 || \ -@@ -411,22 +413,18 @@ +@@ -405,28 +407,23 @@ + /* Type for Unicode characters */ + typedef unsigned long unichar; + +-struct stat; + #define FILE_T_LOCAL 1 + #define FILE_T_WINDOWS 2 protected const char *file_fmttime(uint64_t, int, char *); protected struct magic_set *file_ms_alloc(int); protected void file_ms_free(struct magic_set *); @@ -1391,7 +1473,7 @@ diff -u libmagic.orig/file.h libmagic/file.h +protected int file_buffer(struct magic_set *, php_stream *, const char *, const void *, size_t); -protected int file_fsmagic(struct magic_set *, const char *, struct stat *); -+protected int file_fsmagic(struct magic_set *, const char *, struct stat *, php_stream *); ++protected int file_fsmagic(struct magic_set *, const char *, zend_stat_t *, php_stream *); protected int file_pipe2file(struct magic_set *, int, const void *, size_t); -protected int file_vprintf(struct magic_set *, const char *, va_list) - __attribute__((__format__(__printf__, 2, 0))); @@ -1410,7 +1492,7 @@ diff -u libmagic.orig/file.h libmagic/file.h protected int file_zmagic(struct magic_set *, int, const char *, const unsigned char *, size_t); #endif -@@ -444,16 +442,13 @@ +@@ -444,16 +441,13 @@ protected int file_magicfind(struct magic_set *, const char *, struct mlist *); protected uint64_t file_signextend(struct magic_set *, struct magic *, uint64_t); @@ -1431,7 +1513,7 @@ diff -u libmagic.orig/file.h libmagic/file.h protected void file_showstr(FILE *, const char *, size_t); protected size_t file_mbswidth(const char *); protected const char *file_getbuffer(struct magic_set *); -@@ -463,16 +458,14 @@ +@@ -463,16 +457,14 @@ size_t *); protected size_t file_pstring_length_size(const struct magic *); protected size_t file_pstring_get_length(const struct magic *, const char *); @@ -1449,7 +1531,7 @@ diff -u libmagic.orig/file.h libmagic/file.h #ifndef HAVE_STRERROR extern int sys_nerr; -@@ -485,20 +478,10 @@ +@@ -485,20 +477,10 @@ #define strtoul(a, b, c) strtol(a, b, c) #endif @@ -1472,7 +1554,7 @@ diff -u libmagic.orig/file.h libmagic/file.h size_t strlcat(char *, const char *, size_t); #endif #ifndef HAVE_STRCASESTR -@@ -535,6 +518,14 @@ +@@ -535,6 +517,14 @@ #endif #else #define FILE_RCSID(id) @@ -1489,7 +1571,7 @@ diff -u libmagic.orig/file.h libmagic/file.h #endif /* __file_h__ */ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c --- libmagic.orig/fsmagic.c Sun Dec 1 20:22:13 2013 -+++ libmagic/fsmagic.c Fri Feb 21 00:21:27 2014 ++++ libmagic/fsmagic.c Wed Aug 27 12:35:45 2014 @@ -59,27 +59,21 @@ # define minor(dev) ((dev) & 0xff) #endif @@ -1537,7 +1619,7 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c protected int -file_fsmagic(struct magic_set *ms, const char *fn, struct stat *sb) -+file_fsmagic(struct magic_set *ms, const char *fn, struct stat *sb, php_stream *stream) ++file_fsmagic(struct magic_set *ms, const char *fn, zend_stat_t *sb, php_stream *stream) { int ret, did = 0; int mime = ms->flags & MAGIC_MIME; @@ -1814,7 +1896,16 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c } diff -u libmagic.orig/funcs.c libmagic/funcs.c --- libmagic.orig/funcs.c Thu Feb 13 00:20:53 2014 -+++ libmagic/funcs.c Wed Mar 19 13:28:34 2014 ++++ libmagic/funcs.c Sat Aug 30 10:39:10 2014 +@@ -27,7 +27,7 @@ + #include "file.h" + + #ifndef lint +-FILE_RCSID("@(#)$File: funcs.c,v 1.67 2014/02/12 23:20:53 christos Exp $") ++FILE_RCSID("@(#)$File: funcs.c,v 1.68 2014/02/18 11:09:31 kim Exp $") + #endif /* lint */ + + #include "magic.h" @@ -41,79 +41,79 @@ #if defined(HAVE_WCTYPE_H) #include <wctype.h> @@ -1865,7 +1956,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c - file_error(ms, errno, "vasprintf failed"); - return -1; -} -+extern public void convert_libmagic_pattern(zval *pattern, int options); ++extern public void convert_libmagic_pattern(zval *pattern, char *val, int len, int options); protected int file_printf(struct magic_set *ms, const char *fmt, ...) @@ -1947,7 +2038,26 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c { int m = 0, rv = 0, looks_text = 0; int mime = ms->flags & MAGIC_MIME; -@@ -203,10 +202,10 @@ +@@ -174,8 +173,7 @@ + const char *code_mime = "binary"; + const char *type = "application/octet-stream"; + const char *def = "data"; +- +- ++ const char *ftype = NULL; + + if (nb == 0) { + def = "empty"; +@@ -188,7 +186,7 @@ + + if ((ms->flags & MAGIC_NO_CHECK_ENCODING) == 0) { + looks_text = file_encoding(ms, ubuf, nb, &u8buf, &ulen, +- &code, &code_mime, &type); ++ &code, &code_mime, &ftype); + } + + #ifdef __EMX__ +@@ -203,10 +201,10 @@ } } #endif @@ -1961,7 +2071,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c if ((ms->flags & MAGIC_DEBUG) != 0) (void)fprintf(stderr, "zmagic %d\n", m); goto done_encoding; -@@ -221,12 +220,17 @@ +@@ -221,12 +219,17 @@ } /* Check if we have a CDF file */ @@ -1984,7 +2094,16 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c /* try soft magic tests */ if ((ms->flags & MAGIC_NO_CHECK_SOFT) == 0) -@@ -300,7 +304,6 @@ +@@ -268,7 +271,7 @@ + if ((ms->flags & MAGIC_NO_CHECK_ENCODING) == 0) { + if (looks_text == 0) + if ((m = file_ascmagic_with_encoding( ms, ubuf, +- nb, u8buf, ulen, code, type, looks_text)) ++ nb, u8buf, ulen, code, ftype, looks_text)) + != 0) { + if ((ms->flags & MAGIC_DEBUG) != 0) + (void)fprintf(stderr, +@@ -300,7 +303,6 @@ return m; } @@ -1992,7 +2111,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c protected int file_reset(struct magic_set *ms) -@@ -310,11 +313,11 @@ +@@ -310,11 +312,11 @@ return -1; } if (ms->o.buf) { @@ -2006,7 +2125,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c ms->o.pbuf = NULL; } ms->event_flags &= ~EVENT_HAD_ERR; -@@ -333,7 +336,7 @@ +@@ -333,7 +335,7 @@ protected const char * file_getbuffer(struct magic_set *ms) { @@ -2015,7 +2134,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c size_t psize, len; if (ms->event_flags & EVENT_HAD_ERR) -@@ -348,15 +351,13 @@ +@@ -348,15 +350,13 @@ /* * 4 is for octal representation, + 1 is for NUL */ len = strlen(ms->o.buf); if (len > (SIZE_MAX - 1) / 4) { @@ -2032,7 +2151,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c #if defined(HAVE_WCHAR_H) && defined(HAVE_MBRTOWC) && defined(HAVE_WCWIDTH) { -@@ -416,8 +417,8 @@ +@@ -416,8 +416,8 @@ if (level >= ms->c.len) { len = (ms->c.len += 20) * sizeof(*ms->c.li); ms->c.li = CAST(struct level_info *, (ms->c.li == NULL) ? @@ -2043,7 +2162,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c if (ms->c.li == NULL) { file_oomem(ms, len); return -1; -@@ -437,32 +438,50 @@ +@@ -437,32 +437,42 @@ return ms->o.buf == NULL ? 0 : strlen(ms->o.buf); } @@ -2052,12 +2171,12 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c { - regex_t rx; - int rc, rv = -1; -+ zval *patt; ++ zval patt; + int opts = 0; + pcre_cache_entry *pce; -+ char *res; -+ zval *repl; -+ int res_len, rep_cnt = 0; ++ zend_string *res; ++ zval repl; ++ int rep_cnt = 0; + TSRMLS_FETCH(); (void)setlocale(LC_CTYPE, "C"); @@ -2079,36 +2198,28 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c - regfree(&rx); - rv = nm; + -+ MAKE_STD_ZVAL(patt); -+ ZVAL_STRINGL(patt, pat, strlen(pat), 0); + opts |= PCRE_MULTILINE; -+ convert_libmagic_pattern(patt, opts); -+ if ((pce = pcre_get_compiled_regex_cache(Z_STRVAL_P(patt), Z_STRLEN_P(patt) TSRMLS_CC)) == NULL) { -+ zval_dtor(patt); -+ FREE_ZVAL(patt); ++ convert_libmagic_pattern(&patt, pat, strlen(pat), opts); ++ if ((pce = pcre_get_compiled_regex_cache(Z_STR(patt) TSRMLS_CC)) == NULL) { ++ zval_ptr_dtor(&patt); + rep_cnt = -1; + goto out; } ++ zval_ptr_dtor(&patt); + -+ MAKE_STD_ZVAL(repl); -+ ZVAL_STRINGL(repl, rep, strlen(rep), 0); -+ -+ res = php_pcre_replace_impl(pce, ms->o.buf, strlen(ms->o.buf), repl, -+ 0, &res_len, -1, &rep_cnt TSRMLS_CC); -+ -+ FREE_ZVAL(repl); -+ zval_dtor(patt); -+ FREE_ZVAL(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); + ++ zval_ptr_dtor(&repl); + if (NULL == res) { + rep_cnt = -1; + goto out; + } + -+ strncpy(ms->o.buf, res, res_len); -+ ms->o.buf[res_len] = '\0'; ++ strncpy(ms->o.buf, res->val, res->len); ++ ms->o.buf[res->len] = '\0'; + -+ efree(res); ++ zend_string_release(res); + out: (void)setlocale(LC_CTYPE, ""); @@ -2117,7 +2228,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c } diff -u libmagic.orig/magic.c libmagic/magic.c --- libmagic.orig/magic.c Sun Dec 1 20:22:13 2013 -+++ libmagic/magic.c Fri Feb 21 00:21:27 2014 ++++ libmagic/magic.c Wed Aug 27 20:49:37 2014 @@ -25,11 +25,6 @@ * SUCH DAMAGE. */ @@ -2169,7 +2280,8 @@ diff -u libmagic.orig/magic.c libmagic/magic.c +#endif + private void close_and_restore(const struct magic_set *, const char *, int, - const struct stat *); +- const struct stat *); ++ const zend_stat_t *); private int unreadable_info(struct magic_set *, mode_t, const char *); +#if 0 private const char* get_default_magic(void); @@ -2262,9 +2374,12 @@ diff -u libmagic.orig/magic.c libmagic/magic.c public int magic_list(struct magic_set *ms, const char *magicfile) -@@ -282,9 +288,6 @@ +@@ -280,11 +286,8 @@ + + private void close_and_restore(const struct magic_set *ms, const char *name, int fd, - const struct stat *sb) +- const struct stat *sb) ++ const zend_stat_t *sb) { - if (fd == STDIN_FILENO || name == NULL) - return; @@ -2311,7 +2426,8 @@ diff -u libmagic.orig/magic.c libmagic/magic.c { int rv = -1; unsigned char *buf; - struct stat sb; +- struct stat sb; ++ zend_stat_t sb; ssize_t nbytes = 0; /* number of bytes read from a datafile */ - int ispipe = 0; - off_t pos = (off_t)-1; @@ -2456,7 +2572,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c magic_error(struct magic_set *ms) diff -u libmagic.orig/magic.h libmagic/magic.h --- libmagic.orig/magic.h Wed Feb 19 10:53:11 2014 -+++ libmagic/magic.h Fri Feb 21 00:21:27 2014 ++++ libmagic/magic.h Wed Aug 27 12:35:45 2014 @@ -88,6 +88,7 @@ const char *magic_getpath(const char *, int); @@ -2475,7 +2591,7 @@ diff -u libmagic.orig/magic.h libmagic/magic.h diff -u libmagic.orig/print.c libmagic/print.c --- libmagic.orig/print.c Tue Feb 26 19:25:00 2013 -+++ libmagic/print.c Fri Feb 21 00:21:27 2014 ++++ libmagic/print.c Wed Aug 27 12:35:45 2014 @@ -28,13 +28,17 @@ /* * print.c - debugging printout routines @@ -2706,7 +2822,7 @@ diff -u libmagic.orig/print.c libmagic/print.c } diff -u libmagic.orig/readcdf.c libmagic/readcdf.c --- libmagic.orig/readcdf.c Tue Jan 7 04:13:42 2014 -+++ libmagic/readcdf.c Thu Jun 5 18:05:33 2014 ++++ libmagic/readcdf.c Wed Oct 22 17:56:13 2014 @@ -26,11 +26,15 @@ #include "file.h" @@ -2724,7 +2840,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c #include <string.h> #include <time.h> #include <ctype.h> -@@ -69,6 +73,44 @@ +@@ -69,6 +73,50 @@ { NULL, NULL, }, }; @@ -2743,6 +2859,9 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c + { 0x00000000000c1084LLU, 0x46000000000000c0LLU }, +#endif + "x-msi", ++ }, ++ { { 0, 0 }, ++ NULL, + } +}, clsid2desc[] = { + { @@ -2753,6 +2872,9 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c +#endif + "MSI Installer", + }, ++ { { 0, 0 }, ++ NULL, ++ } +}; + +private const char * @@ -2769,7 +2891,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c private const char * cdf_app_to_mime(const char *vbuf, const struct nv *nv) { -@@ -87,16 +129,21 @@ +@@ -87,16 +135,21 @@ private int cdf_file_property_info(struct magic_set *ms, const cdf_property_info_t *info, @@ -2793,7 +2915,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c for (i = 0; i < count; i++) { cdf_print_property_name(buf, sizeof(buf), info[i].pi_id); switch (info[i].pi_type) { -@@ -153,7 +200,7 @@ +@@ -153,7 +206,7 @@ buf, vbuf) == -1) return -1; } @@ -2802,7 +2924,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c CDF_PROPERTY_NAME_OF_APPLICATION) { str = cdf_app_to_mime(vbuf, app2mime); } -@@ -162,8 +209,12 @@ +@@ -162,8 +215,12 @@ case CDF_FILETIME: tp = info[i].pi_tp; if (tp != 0) { @@ -2817,7 +2939,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c cdf_print_elapsed_time(tbuf, sizeof(tbuf), tp); if (NOTMIME(ms) && file_printf(ms, -@@ -171,8 +222,11 @@ +@@ -171,8 +228,11 @@ return -1; } else { char *c, *ec; @@ -2831,7 +2953,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c if (c != NULL && (ec = strchr(c, '\n')) != NULL) *ec = '\0'; -@@ -200,7 +254,7 @@ +@@ -200,7 +260,7 @@ private int cdf_file_summary_info(struct magic_set *ms, const cdf_header_t *h, @@ -2840,7 +2962,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c { cdf_summary_info_header_t si; cdf_property_info_t *info; -@@ -211,6 +265,8 @@ +@@ -211,6 +271,8 @@ return -1; if (NOTMIME(ms)) { @@ -2849,7 +2971,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c if (file_printf(ms, "Composite Document File V2 Document") == -1) return -1; -@@ -238,9 +294,15 @@ +@@ -238,9 +300,15 @@ return -2; break; } @@ -2867,7 +2989,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c free(info); return m == -1 ? -2 : m; -@@ -258,6 +320,7 @@ +@@ -258,6 +326,7 @@ int i; const char *expn = ""; const char *corrupt = "corrupt: "; @@ -2875,7 +2997,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c info.i_fd = fd; info.i_buf = buf; -@@ -291,7 +354,8 @@ +@@ -291,7 +360,8 @@ goto out2; } @@ -2885,7 +3007,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c expn = "Cannot read short stream"; goto out3; } -@@ -312,23 +376,21 @@ +@@ -312,23 +382,21 @@ #ifdef CDF_DEBUG cdf_dump_summary_info(&h, &scn); #endif @@ -2918,14 +3040,23 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c if (str != NULL) { diff -u libmagic.orig/readelf.c libmagic/readelf.c --- libmagic.orig/readelf.c Tue Nov 5 16:44:01 2013 -+++ libmagic/readelf.c Fri Feb 21 00:21:27 2014 -@@ -48,8 +48,8 @@ ++++ libmagic/readelf.c Sat Oct 25 11:42:59 2014 +@@ -42,14 +42,14 @@ + #include "magic.h" + + #ifdef ELFCORE +-private int dophn_core(struct magic_set *, int, int, int, off_t, int, size_t, +- off_t, int *); ++private int dophn_core(struct magic_set *, int, int, int, zend_off_t, int, size_t, ++ zend_off_t, int *); + #endif private int dophn_exec(struct magic_set *, int, int, int, off_t, int, size_t, - off_t, int *, int); +- off_t, int *, int); ++ zend_off_t, int *, int); private int doshn(struct magic_set *, int, int, int, off_t, int, size_t, - off_t, int *, int, int); -private size_t donote(struct magic_set *, void *, size_t, size_t, int, -+ off_t, int *, int); ++ zend_off_t, int *, int); +private size_t donote(struct magic_set *, unsigned char *, size_t, size_t, int, int, size_t, int *); @@ -2945,7 +3076,40 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c #define xsh_addr (clazz == ELFCLASS32 \ ? (void *)&sh32 \ -@@ -292,7 +298,7 @@ +@@ -138,7 +144,7 @@ + #define xsh_size (size_t)(clazz == ELFCLASS32 \ + ? elf_getu32(swap, sh32.sh_size) \ + : elf_getu64(swap, sh64.sh_size)) +-#define xsh_offset (off_t)(clazz == ELFCLASS32 \ ++#define xsh_offset (zend_off_t)(clazz == ELFCLASS32 \ + ? elf_getu32(swap, sh32.sh_offset) \ + : elf_getu64(swap, sh64.sh_offset)) + #define xsh_type (clazz == ELFCLASS32 \ +@@ -156,13 +162,13 @@ + #define xph_type (clazz == ELFCLASS32 \ + ? elf_getu32(swap, ph32.p_type) \ + : elf_getu32(swap, ph64.p_type)) +-#define xph_offset (off_t)(clazz == ELFCLASS32 \ ++#define xph_offset (zend_off_t)(clazz == ELFCLASS32 \ + ? elf_getu32(swap, ph32.p_offset) \ + : elf_getu64(swap, ph64.p_offset)) + #define xph_align (size_t)((clazz == ELFCLASS32 \ +- ? (off_t) (ph32.p_align ? \ ++ ? (zend_off_t) (ph32.p_align ? \ + elf_getu32(swap, ph32.p_align) : 4) \ +- : (off_t) (ph64.p_align ? \ ++ : (zend_off_t) (ph64.p_align ? \ + elf_getu64(swap, ph64.p_align) : 4))) + #define xph_filesz (size_t)((clazz == ELFCLASS32 \ + ? elf_getu32(swap, ph32.p_filesz) \ +@@ -287,12 +293,12 @@ + #define FLAGS_IS_CORE 0x10 + + private int +-dophn_core(struct magic_set *ms, int clazz, int swap, int fd, off_t off, +- int num, size_t size, off_t fsize, int *flags) ++dophn_core(struct magic_set *ms, int clazz, int swap, int fd, zend_off_t off, ++ int num, size_t size, zend_off_t fsize, int *flags) { Elf32_Phdr ph32; Elf64_Phdr ph64; @@ -2959,7 +3123,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c */ for ( ; num; num--) { - if (pread(fd, xph_addr, xph_sizeof, off) == -1) { -+ if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (off_t)-1) { ++ if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (zend_off_t)-1) { + file_badseek(ms); + return -1; + } @@ -2973,7 +3137,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c */ - len = xph_filesz < sizeof(nbuf) ? xph_filesz : sizeof(nbuf); - if ((bufsize = pread(fd, nbuf, len, xph_offset)) == -1) { -+ if (FINFO_LSEEK_FUNC(fd, xph_offset, SEEK_SET) == (off_t)-1) { ++ if (FINFO_LSEEK_FUNC(fd, xph_offset, SEEK_SET) == (zend_off_t)-1) { + file_badseek(ms); + return -1; + } @@ -2983,7 +3147,30 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c file_badread(ms); return -1; } -@@ -913,24 +928,12 @@ +@@ -477,6 +492,13 @@ + uint32_t namesz, descsz; + unsigned char *nbuf = CAST(unsigned char *, vbuf); + ++ if (xnh_sizeof + offset > size) { ++ /* ++ * We're out of note headers. ++ */ ++ return xnh_sizeof + offset; ++ } ++ + (void)memcpy(xnh_addr, &nbuf[offset], xnh_sizeof); + offset += xnh_sizeof; + +@@ -902,7 +924,7 @@ + Elf64_Shdr sh64; + int stripped = 1; + void *nbuf; +- off_t noff, coff, name_off; ++ zend_off_t noff, coff, name_off; + uint64_t cap_hw1 = 0; /* SunOS 5.x hardware capabilites */ + uint64_t cap_sf1 = 0; /* SunOS 5.x software capabilites */ + char name[50]; +@@ -913,24 +935,12 @@ return 0; } @@ -2998,7 +3185,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c - /* Read the name of this section. */ - if (pread(fd, name, sizeof(name), name_off + xsh_name) == -1) { - file_badread(ms); -+ if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (off_t)-1) { ++ if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (zend_off_t)-1) { + file_badseek(ms); return -1; } @@ -3011,7 +3198,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c file_badread(ms); return -1; } -@@ -955,14 +958,17 @@ +@@ -955,41 +965,35 @@ /* Things we can determine when we seek */ switch (xsh_type) { case SHT_NOTE: @@ -3019,8 +3206,8 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c - file_error(ms, errno, "Cannot allocate memory" - " for note"); + nbuf = emalloc((size_t)xsh_size); -+ if ((noff = FINFO_LSEEK_FUNC(fd, (off_t)xsh_offset, SEEK_SET)) == -+ (off_t)-1) { ++ if ((noff = FINFO_LSEEK_FUNC(fd, (zend_off_t)xsh_offset, SEEK_SET)) == ++ (zend_off_t)-1) { + file_badread(ms); + efree(nbuf); return -1; @@ -3034,8 +3221,10 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c return -1; } -@@ -971,25 +977,16 @@ - if (noff >= (off_t)xsh_size) + noff = 0; + for (;;) { +- if (noff >= (off_t)xsh_size) ++ if (noff >= (zend_off_t)xsh_size) break; noff = donote(ms, nbuf, (size_t)noff, - xsh_size, clazz, swap, 4, flags); @@ -3060,21 +3249,24 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c - } - - if (lseek(fd, xsh_offset, SEEK_SET) == (off_t)-1) { -+ if (FINFO_LSEEK_FUNC(fd, (off_t)xsh_offset, SEEK_SET) == -+ (off_t)-1) { ++ if (FINFO_LSEEK_FUNC(fd, (zend_off_t)xsh_offset, SEEK_SET) == ++ (zend_off_t)-1) { file_badseek(ms); return -1; } -@@ -1001,7 +998,7 @@ +@@ -999,9 +1003,9 @@ + Elf64_Cap cap64; + char cbuf[/*CONSTCOND*/ MAX(sizeof cap32, sizeof cap64)]; - if ((coff += xcap_sizeof) > (off_t)xsh_size) +- if ((coff += xcap_sizeof) > (off_t)xsh_size) ++ if ((coff += xcap_sizeof) > (zend_off_t)xsh_size) break; - if (read(fd, cbuf, (size_t)xcap_sizeof) != + if (FINFO_READ_FUNC(fd, cbuf, (size_t)xcap_sizeof) != (ssize_t)xcap_sizeof) { file_badread(ms); return -1; -@@ -1027,13 +1024,12 @@ +@@ -1027,13 +1031,12 @@ break; } } @@ -3090,7 +3282,18 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c if (file_printf(ms, ", %sstripped", stripped ? "" : "not ") == -1) return -1; if (cap_hw1) { -@@ -1112,7 +1108,7 @@ +@@ -1103,8 +1106,8 @@ + * otherwise it's statically linked. + */ + private int +-dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, off_t off, +- int num, size_t size, off_t fsize, int *flags, int sh_num) ++dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, zend_off_t off, ++ int num, size_t size, zend_off_t fsize, int *flags, int sh_num) + { + Elf32_Phdr ph32; + Elf64_Phdr ph64; +@@ -1112,7 +1115,7 @@ const char *shared_libraries = ""; unsigned char nbuf[BUFSIZ]; ssize_t bufsize; @@ -3099,13 +3302,13 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c if (size != xph_sizeof) { if (file_printf(ms, ", corrupted program header size") == -1) -@@ -1121,8 +1117,13 @@ +@@ -1121,8 +1124,13 @@ } for ( ; num; num--) { - if (pread(fd, xph_addr, xph_sizeof, off) == -1) { - file_badread(ms); -+ if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (off_t)-1) { ++ if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (zend_off_t)-1) { + file_badseek(ms); + return -1; + } @@ -3115,14 +3318,14 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c return -1; } -@@ -1160,9 +1161,12 @@ +@@ -1160,9 +1168,12 @@ * This is a PT_NOTE section; loop through all the notes * in the section. */ - len = xph_filesz < sizeof(nbuf) ? xph_filesz - : sizeof(nbuf); - bufsize = pread(fd, nbuf, len, xph_offset); -+ if (FINFO_LSEEK_FUNC(fd, xph_offset, SEEK_SET) == (off_t)-1) { ++ if (FINFO_LSEEK_FUNC(fd, xph_offset, SEEK_SET) == (zend_off_t)-1) { + file_badseek(ms); + return -1; + } @@ -3131,18 +3334,27 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c if (bufsize == -1) { file_badread(ms); return -1; -@@ -1223,7 +1227,7 @@ +@@ -1200,7 +1211,7 @@ + int clazz; + int swap; + struct stat st; +- off_t fsize; ++ zend_off_t fsize; + int flags = 0; + Elf32_Ehdr elf32hdr; + Elf64_Ehdr elf64hdr; +@@ -1223,7 +1234,7 @@ /* * If we cannot seek, it must be a pipe, socket or fifo. */ - if((lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1) && (errno == ESPIPE)) -+ if((FINFO_LSEEK_FUNC(fd, (off_t)0, SEEK_SET) == (off_t)-1) && (errno == ESPIPE)) ++ if((FINFO_LSEEK_FUNC(fd, (zend_off_t)0, SEEK_SET) == (zend_off_t)-1) && (errno == ESPIPE)) fd = file_pipe2file(ms, fd, buf, nbytes); if (fstat(fd, &st) == -1) { diff -u libmagic.orig/readelf.h libmagic/readelf.h --- libmagic.orig/readelf.h Tue Nov 5 16:41:56 2013 -+++ libmagic/readelf.h Fri Feb 21 00:21:27 2014 ++++ libmagic/readelf.h Wed Aug 27 12:35:45 2014 @@ -44,9 +44,17 @@ typedef uint32_t Elf32_Word; typedef uint8_t Elf32_Char; @@ -3163,7 +3375,7 @@ diff -u libmagic.orig/readelf.h libmagic/readelf.h typedef uint8_t Elf64_Char; diff -u libmagic.orig/softmagic.c libmagic/softmagic.c --- libmagic.orig/softmagic.c Thu Feb 13 00:20:53 2014 -+++ libmagic/softmagic.c Tue Jul 1 08:57:25 2014 ++++ libmagic/softmagic.c Fri Sep 19 16:29:55 2014 @@ -50,6 +50,11 @@ #include <locale.h> #endif @@ -3176,6 +3388,15 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c private int match(struct magic_set *, struct magic *, uint32_t, const unsigned char *, size_t, size_t, int, int, int, int, int *, int *, +@@ -62,7 +67,7 @@ + private int32_t moffset(struct magic_set *, struct magic *); + private void mdebug(uint32_t, const char *, size_t); + private int mcopy(struct magic_set *, union VALUETYPE *, int, int, +- const unsigned char *, uint32_t, size_t, size_t); ++ const unsigned char *, uint32_t, size_t, struct magic *); + private int mconvert(struct magic_set *, struct magic *, int); + private int print_sep(struct magic_set *, int); + private int handle_annotation(struct magic_set *, struct magic *); @@ -71,7 +76,8 @@ private void cvt_32(union VALUETYPE *, const struct magic *); private void cvt_64(union VALUETYPE *, const struct magic *); @@ -3206,7 +3427,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c m = &magic[magindex]; ms->line = m->lineno; /* for messages */ -@@ -350,46 +356,24 @@ +@@ -350,46 +356,27 @@ private int check_fmt(struct magic_set *ms, struct magic *m) { @@ -3216,6 +3437,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c + pcre *pce; + int re_options, rv = -1; + pcre_extra *re_extra; ++ zend_string *pattern; + TSRMLS_FETCH(); + if (strchr(m->desc, '%') == NULL) @@ -3227,7 +3449,8 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c - char errmsg[512]; - (void)regerror(rc, &rx, errmsg, sizeof(errmsg)); - file_magerror(ms, "regex error %d, (%s)", rc, errmsg); -+ if ((pce = pcre_get_compiled_regex("~%[-0-9.]*s~", &re_extra, &re_options TSRMLS_CC)) == NULL) { ++ 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) { + rv = -1; } else { - rc = regexec(&rx, m->desc, 0, 0, 0); @@ -3235,6 +3458,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c - rv = !rc; + rv = !pcre_exec(pce, re_extra, m->desc, strlen(m->desc), 0, re_options, NULL, 0); } ++ zend_string_release(pattern); (void)setlocale(LC_CTYPE, ""); return rv; } @@ -3261,7 +3485,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c private int32_t mprint(struct magic_set *ms, struct magic *m) { -@@ -618,13 +602,13 @@ +@@ -618,13 +605,13 @@ char *cp; int rval; @@ -3277,7 +3501,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c if (rval == -1) return -1; -@@ -870,16 +854,16 @@ +@@ -870,16 +857,16 @@ if (m->num_mask) \ switch (m->mask_op & FILE_OPS_MASK) { \ case FILE_OPADD: \ @@ -3298,7 +3522,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c break; \ } \ -@@ -931,10 +915,18 @@ +@@ -931,10 +918,18 @@ return 1; } case FILE_PSTRING: { @@ -3320,9 +3544,72 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c while (len--) *ptr1++ = *ptr2++; *ptr1 = '\0'; -@@ -1178,9 +1170,6 @@ - "nbytes=%zu, count=%u)\n", m->type, m->flag, offset, o, - nbytes, count); +@@ -1046,7 +1041,7 @@ + + private int + mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir, +- const unsigned char *s, uint32_t offset, size_t nbytes, size_t linecnt) ++ const unsigned char *s, uint32_t offset, size_t nbytes, struct magic *m) + { + /* + * Note: FILE_SEARCH and FILE_REGEX do not actually copy +@@ -1066,15 +1061,24 @@ + const char *last; /* end of search region */ + const char *buf; /* start of search region */ + const char *end; +- size_t lines; ++ size_t lines, linecnt, bytecnt; ++ ++ linecnt = m->str_range; ++ bytecnt = linecnt * 80; + ++ if (bytecnt == 0) { ++ bytecnt = 8192; ++ } ++ if (bytecnt > nbytes) { ++ bytecnt = nbytes; ++ } + if (s == NULL) { + ms->search.s_len = 0; + ms->search.s = NULL; + return 0; + } + buf = RCAST(const char *, s) + offset; +- end = last = RCAST(const char *, s) + nbytes; ++ end = last = RCAST(const char *, s) + bytecnt; + /* mget() guarantees buf <= last */ + for (lines = linecnt, b = buf; lines && b < end && + ((b = CAST(const char *, +@@ -1087,7 +1091,7 @@ + b++; + } + if (lines) +- last = RCAST(const char *, s) + nbytes; ++ last = RCAST(const char *, s) + bytecnt; + + ms->search.s = buf; + ms->search.s_len = last - buf; +@@ -1158,7 +1162,6 @@ + int *need_separator, int *returnval) + { + uint32_t soffset, offset = ms->offset; +- uint32_t count = m->str_range; + int rv, oneed_separator, in_type; + char *sbuf, *rbuf; + union VALUETYPE *p = &ms->ms_value; +@@ -1170,17 +1173,13 @@ + } + + if (mcopy(ms, p, m->type, m->flag & INDIR, s, (uint32_t)(offset + o), +- (uint32_t)nbytes, count) == -1) ++ (uint32_t)nbytes, m) == -1) + return -1; + + if ((ms->flags & MAGIC_DEBUG) != 0) { + fprintf(stderr, "mget(type=%d, flag=%x, offset=%u, o=%zu, " +- "nbytes=%zu, count=%u)\n", m->type, m->flag, offset, o, +- nbytes, count); ++ "nbytes=%zu)\n", m->type, m->flag, offset, o, nbytes); mdebug(offset, (char *)(void *)p, sizeof(union VALUETYPE)); -#ifndef COMPILE_ONLY - file_mdump(m); @@ -3330,7 +3617,15 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c } if (m->flag & INDIR) { -@@ -1679,9 +1668,6 @@ +@@ -1672,16 +1671,13 @@ + if ((ms->flags & MAGIC_DEBUG) != 0) + fprintf(stderr, "indirect +offs=%u\n", offset); + } +- if (mcopy(ms, p, m->type, 0, s, offset, nbytes, count) == -1) ++ if (mcopy(ms, p, m->type, 0, s, offset, nbytes, m) == -1) + return -1; + ms->offset = offset; + if ((ms->flags & MAGIC_DEBUG) != 0) { mdebug(offset, (char *)(void *)p, sizeof(union VALUETYPE)); @@ -3340,7 +3635,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c } } -@@ -1755,11 +1741,21 @@ +@@ -1755,11 +1751,21 @@ ms->offset = soffset; if (rv == 1) { if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 && @@ -3365,50 +3660,49 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c } return rv; -@@ -1875,6 +1871,42 @@ +@@ -1875,6 +1881,41 @@ return file_strncmp(a, b, len, flags); } +public void -+convert_libmagic_pattern(zval *pattern, int options) ++convert_libmagic_pattern(zval *pattern, char *val, int len, int options) +{ -+ int i, j=0; -+ char *t; ++ int i, j=0; ++ zend_string *t; + -+ t = (char *) safe_emalloc(Z_STRLEN_P(pattern), 2, 5); -+ -+ t[j++] = '~'; -+ -+ for (i=0; i<Z_STRLEN_P(pattern); i++, j++) { -+ switch (Z_STRVAL_P(pattern)[i]) { -+ case '~': -+ t[j++] = '\\'; -+ t[j] = '~'; -+ break; -+ default: -+ t[j] = Z_STRVAL_P(pattern)[i]; -+ break; -+ } ++ t = zend_string_alloc(len * 2 + 4, 0); ++ ++ t->val[j++] = '~'; ++ ++ for (i = 0; i < len; i++, j++) { ++ switch (val[i]) { ++ case '~': ++ t->val[j++] = '\\'; ++ t->val[j] = '~'; ++ break; ++ default: ++ t->val[j] = val[i]; ++ break; + } -+ t[j++] = '~'; -+ -+ if (options & PCRE_CASELESS) -+ t[j++] = 'i'; -+ -+ if (options & PCRE_MULTILINE) -+ t[j++] = 'm'; ++ } ++ t->val[j++] = '~'; + -+ t[j]='\0'; -+ -+ Z_STRVAL_P(pattern) = t; -+ Z_STRLEN_P(pattern) = j; ++ if (options & PCRE_CASELESS) ++ t->val[j++] = 'i'; ++ ++ if (options & PCRE_MULTILINE) ++ t->val[j++] = 'm'; + ++ t->val[j]='\0'; ++ t->len = j; ++ ++ ZVAL_NEW_STR(pattern, t); +} + private int magiccheck(struct magic_set *ms, struct magic *m) { -@@ -2035,63 +2067,151 @@ +@@ -2035,63 +2076,112 @@ break; } case FILE_REGEX: { @@ -3418,141 +3712,61 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c - - if (ms->search.s == NULL) - return 0; -+ zval *pattern; ++ zval pattern; + int options = 0; + pcre_cache_entry *pce; + TSRMLS_FETCH(); + -+ MAKE_STD_ZVAL(pattern); -+ ZVAL_STRINGL(pattern, (char *)m->value.s, m->vallen, 0); -+ + options |= PCRE_MULTILINE; + + if (m->str_flags & STRING_IGNORE_CASE) { + options |= PCRE_CASELESS; + } + -+ convert_libmagic_pattern(pattern, options); ++ convert_libmagic_pattern(&pattern, (char *)m->value.s, m->vallen, options); + + l = v = 0; -+ if ((pce = pcre_get_compiled_regex_cache(Z_STRVAL_P(pattern), Z_STRLEN_P(pattern) TSRMLS_CC)) == NULL) { -+ zval_dtor(pattern); -+ FREE_ZVAL(pattern); ++ if ((pce = pcre_get_compiled_regex_cache(Z_STR(pattern) TSRMLS_CC)) == NULL) { ++ zval_ptr_dtor(&pattern); + return -1; + } else { + /* pce now contains the compiled regex */ -+ zval *retval; -+ zval *subpats; ++ zval retval; ++ zval subpats; + char *haystack; + -+ MAKE_STD_ZVAL(retval); -+ ALLOC_INIT_ZVAL(subpats); -+ ++ ZVAL_NULL(&retval); ++ ZVAL_NULL(&subpats); ++ + /* Cut the search len from haystack, equals to REG_STARTEND */ + 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 TSRMLS_CC); + /* Free haystack */ + efree(haystack); + -+ if (Z_LVAL_P(retval) < 0) { ++ if (Z_LVAL(retval) < 0) { + zval_ptr_dtor(&subpats); -+ FREE_ZVAL(retval); -+ zval_dtor(pattern); -+ FREE_ZVAL(pattern); ++ zval_ptr_dtor(&pattern); + return -1; -+ } else if ((Z_LVAL_P(retval) > 0) && (Z_TYPE_P(subpats) == IS_ARRAY)) { -+ ++ } else if ((Z_LVAL(retval) > 0) && (Z_TYPE(subpats) == IS_ARRAY)) { + /* Need to fetch global match which equals pmatch[0] */ -+ HashTable *ht = Z_ARRVAL_P(subpats); -+ HashPosition outer_pos; ++ zval *pzval; ++ HashTable *ht = Z_ARRVAL(subpats); + zval *pattern_match = NULL, *pattern_offset = NULL; -+ -+ zend_hash_internal_pointer_reset_ex(ht, &outer_pos); -+ -+ if (zend_hash_has_more_elements_ex(ht, &outer_pos) == SUCCESS && -+ zend_hash_move_forward_ex(ht, &outer_pos)) { -+ -+ zval **ppzval; -+ -+ /* The first element (should be) is the global match -+ Need to move to the inner array to get the global match */ -+ -+ if (zend_hash_get_current_data_ex(ht, (void**)&ppzval, &outer_pos) != FAILURE) { -+ -+ HashTable *inner_ht; -+ HashPosition inner_pos; -+ zval **match, **offset; -+ zval tmpcopy = **ppzval, matchcopy, offsetcopy; -+ -+ zval_copy_ctor(&tmpcopy); -+ INIT_PZVAL(&tmpcopy); -+ -+ inner_ht = Z_ARRVAL(tmpcopy); -+ -+ /* If everything goes according to the master plan -+ tmpcopy now contains two elements: -+ 0 = the match -+ 1 = starting position of the match */ -+ zend_hash_internal_pointer_reset_ex(inner_ht, &inner_pos); -+ -+ if (zend_hash_has_more_elements_ex(inner_ht, &inner_pos) == SUCCESS && -+ zend_hash_move_forward_ex(inner_ht, &inner_pos)) { -+ -+ if (zend_hash_get_current_data_ex(inner_ht, (void**)&match, &inner_pos) != FAILURE) { -+ -+ matchcopy = **match; -+ zval_copy_ctor(&matchcopy); -+ INIT_PZVAL(&matchcopy); -+ convert_to_string(&matchcopy); -+ -+ MAKE_STD_ZVAL(pattern_match); -+ Z_STRVAL_P(pattern_match) = (char *)Z_STRVAL(matchcopy); -+ Z_STRLEN_P(pattern_match) = Z_STRLEN(matchcopy); -+ Z_TYPE_P(pattern_match) = IS_STRING; -+ -+ zval_dtor(&matchcopy); -+ } -+ } -+ -+ if (zend_hash_has_more_elements_ex(inner_ht, &inner_pos) == SUCCESS && -+ zend_hash_move_forward_ex(inner_ht, &inner_pos)) { -+ -+ if (zend_hash_get_current_data_ex(inner_ht, (void**)&offset, &inner_pos) != FAILURE) { -+ -+ offsetcopy = **offset; -+ zval_copy_ctor(&offsetcopy); -+ INIT_PZVAL(&offsetcopy); -+ convert_to_long(&offsetcopy); -+ -+ MAKE_STD_ZVAL(pattern_offset); -+ Z_LVAL_P(pattern_offset) = Z_LVAL(offsetcopy); -+ Z_TYPE_P(pattern_offset) = IS_LONG; -+ -+ zval_dtor(&offsetcopy); -+ } -+ } -+ zval_dtor(&tmpcopy); -+ } -+ -+ if ((pattern_match != NULL) && (pattern_offset != NULL)) { -+ ms->search.s += (int)Z_LVAL_P(pattern_offset); /* this is where the match starts */ -+ ms->search.offset += (size_t)Z_LVAL_P(pattern_offset); /* this is where the match starts as size_t */ -+ ms->search.rm_len = Z_STRLEN_P(pattern_match) /* This is the length of the matched pattern */; -+ v = 0; -+ -+ efree(pattern_match); -+ efree(pattern_offset); -+ -+ } else { -+ zval_ptr_dtor(&subpats); -+ FREE_ZVAL(retval); -+ zval_dtor(pattern); -+ FREE_ZVAL(pattern); -+ return -1; ++ int first = 1, inner_first; ++ ++ ZEND_HASH_FOREACH_VAL(ht, pzval) { ++ HashTable *inner_ht; ++ zval *match, *offset; ++ zval tmpcopy, matchcopy, offsetcopy; ++ ++ if (first) { ++ first = 0; ++ continue; + } -+ } ++ ZVAL_DUP(&tmpcopy, pzval); - l = 0; - rc = regcomp(&rx, m->value.s, @@ -3588,8 +3802,51 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c - (size_t)(pmatch[0].rm_eo - pmatch[0].rm_so); - v = 0; - break; ++ inner_ht = Z_ARRVAL(tmpcopy); - case REG_NOMATCH: ++ /* If everything goes according to the master plan ++ tmpcopy now contains two elements: ++ 0 = the match ++ 1 = starting position of the match */ ++ inner_first = 1; ++ ZEND_HASH_FOREACH_VAL(inner_ht, match) { ++ if (inner_first) { ++ inner_first = 0; ++ continue; ++ } ++ ZVAL_DUP(&matchcopy, match); ++ convert_to_string(&matchcopy); ++ pattern_match = &matchcopy; ++ } ZEND_HASH_FOREACH_END(); ++ ++ inner_first = 1; ++ ZEND_HASH_FOREACH_VAL(inner_ht, offset) { ++ if (inner_first) { ++ inner_first = 0; ++ continue; ++ } ++ ZVAL_DUP(&offsetcopy, offset); ++ convert_to_long(&offsetcopy); ++ pattern_offset = &offsetcopy; ++ } ZEND_HASH_FOREACH_END(); ++ ++ zval_dtor(&tmpcopy); ++ ++ if ((pattern_match != NULL) && (pattern_offset != NULL)) { ++ ms->search.s += Z_LVAL_P(pattern_offset); /* this is where the match starts */ ++ ms->search.offset += Z_LVAL_P(pattern_offset); /* this is where the match starts as size_t */ ++ ms->search.rm_len = Z_STRLEN_P(pattern_match) /* This is the length of the matched pattern */; ++ v = 0; ++ ++ zval_ptr_dtor(pattern_match); ++ zval_ptr_dtor(pattern_offset); ++ } else { ++ zval_ptr_dtor(&subpats); ++ zval_ptr_dtor(&pattern); ++ return -1; ++ } ++ } ZEND_HASH_FOREACH_END(); + } else { v = 1; - break; @@ -3603,18 +3860,16 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c } - regfree(&rx); + zval_ptr_dtor(&subpats); -+ FREE_ZVAL(retval); ++ zval_ptr_dtor(&pattern); } - if (v == (uint64_t)-1) - return -1; -+ zval_dtor(pattern); -+ FREE_ZVAL(pattern); break; } case FILE_INDIRECT: diff -u libmagic.orig/strcasestr.c libmagic/strcasestr.c --- libmagic.orig/strcasestr.c Thu Dec 5 17:57:50 2013 -+++ libmagic/strcasestr.c Sun May 4 21:29:20 2014 ++++ libmagic/strcasestr.c Wed Aug 27 12:35:45 2014 @@ -37,6 +37,8 @@ __RCSID("$NetBSD: strncasecmp.c,v 1.2 2007/06/04 18:19:27 christos Exp $"); #endif /* LIBC_SCCS and not lint */ diff --git a/ext/fileinfo/libmagic/readcdf.c b/ext/fileinfo/libmagic/readcdf.c index ec97ced44b..175719a2d7 100644 --- a/ext/fileinfo/libmagic/readcdf.c +++ b/ext/fileinfo/libmagic/readcdf.c @@ -88,6 +88,9 @@ static const struct cv { { 0x00000000000c1084LLU, 0x46000000000000c0LLU }, #endif "x-msi", + }, + { { 0, 0 }, + NULL, } }, clsid2desc[] = { { @@ -98,6 +101,9 @@ static const struct cv { #endif "MSI Installer", }, + { { 0, 0 }, + NULL, + } }; private const char * diff --git a/ext/fileinfo/libmagic/readelf.c b/ext/fileinfo/libmagic/readelf.c index 3b0aae54c1..a849c1a098 100644 --- a/ext/fileinfo/libmagic/readelf.c +++ b/ext/fileinfo/libmagic/readelf.c @@ -492,6 +492,13 @@ donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size, uint32_t namesz, descsz; unsigned char *nbuf = CAST(unsigned char *, vbuf); + if (xnh_sizeof + offset > size) { + /* + * We're out of note headers. + */ + return xnh_sizeof + offset; + } + (void)memcpy(xnh_addr, &nbuf[offset], xnh_sizeof); offset += xnh_sizeof; diff --git a/ext/fileinfo/tests/precedural_finfo_in_method.phpt b/ext/fileinfo/tests/precedural_finfo_in_method.phpt new file mode 100644 index 0000000000..8c30b8a197 --- /dev/null +++ b/ext/fileinfo/tests/precedural_finfo_in_method.phpt @@ -0,0 +1,18 @@ +--TEST-- +Using procedural finfo API in a method +--FILE-- +<?php + +class Test { + public function method() { + $finfo = finfo_open(FILEINFO_MIME); + var_dump(finfo_file($finfo, __FILE__)); + } +} + +$test = new Test; +$test->method(); + +?> +--EXPECT-- +string(28) "text/plain; charset=us-ascii" diff --git a/ext/filter/filter.c b/ext/filter/filter.c index 7ef65bc196..530dce6f53 100644 --- a/ext/filter/filter.c +++ b/ext/filter/filter.c @@ -491,7 +491,8 @@ static void php_zval_filter_recursive(zval *value, zend_long filter, zend_long f } ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(value), element) { - SEPARATE_ZVAL_IF_NOT_REF(element); + ZVAL_DEREF(element); + 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); @@ -581,9 +582,7 @@ static void php_filter_call(zval *filtered, zend_long filter, zval *filter_args, char *charset = NULL; if (filter_args && Z_TYPE_P(filter_args) != IS_ARRAY) { - zend_long lval; - - PHP_FILTER_GET_LONG_OPT(filter_args, lval); + zend_long lval = zval_get_long(filter_args); if (filter != -1) { /* handler for array apply */ /* filter_args is the filter_flags */ @@ -597,11 +596,11 @@ static void php_filter_call(zval *filtered, zend_long filter, zval *filter_args, } } else if (filter_args) { if ((option = zend_hash_str_find(HASH_OF(filter_args), "filter", sizeof("filter") - 1)) != NULL) { - PHP_FILTER_GET_LONG_OPT(option, filter); + filter = zval_get_long(option); } if ((option = zend_hash_str_find(HASH_OF(filter_args), "flags", sizeof("flags") - 1)) != NULL) { - PHP_FILTER_GET_LONG_OPT(option, filter_flags); + filter_flags = zval_get_long(option); if (!(filter_flags & FILTER_REQUIRE_ARRAY || filter_flags & FILTER_FORCE_ARRAY)) { filter_flags |= FILTER_REQUIRE_SCALAR; @@ -661,7 +660,6 @@ 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) /* {{{ */ { - zend_ulong index; zend_string *arg_key; zval *tmp, *arg_elm; @@ -676,7 +674,7 @@ static void php_filter_array_handler(zval *input, zval *op, zval *return_value, } else if (Z_TYPE_P(op) == IS_ARRAY) { array_init(return_value); - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(op), index, arg_key, arg_elm) { + 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"); zval_ptr_dtor(return_value); @@ -732,7 +730,7 @@ PHP_FUNCTION(filter_input) if (Z_TYPE_P(filter_args) == IS_LONG) { filter_flags = Z_LVAL_P(filter_args); } else if (Z_TYPE_P(filter_args) == IS_ARRAY && (option = zend_hash_str_find(HASH_OF(filter_args), "flags", sizeof("flags") - 1)) != NULL) { - PHP_FILTER_GET_LONG_OPT(option, filter_flags); + filter_flags = zval_get_long(option); } if (Z_TYPE_P(filter_args) == IS_ARRAY && (opt = zend_hash_str_find(HASH_OF(filter_args), "options", sizeof("options") - 1)) != NULL && @@ -809,7 +807,7 @@ PHP_FUNCTION(filter_input_array) if (Z_TYPE_P(op) == IS_LONG) { filter_flags = Z_LVAL_P(op); } else if (Z_TYPE_P(op) == IS_ARRAY && (option = zend_hash_str_find(HASH_OF(op), "flags", sizeof("flags") - 1)) != NULL) { - PHP_FILTER_GET_LONG_OPT(option, filter_flags); + filter_flags = zval_get_long(option); } } diff --git a/ext/filter/filter_private.h b/ext/filter/filter_private.h index 8c41d8811e..b07b6ca534 100644 --- a/ext/filter/filter_private.h +++ b/ext/filter/filter_private.h @@ -117,17 +117,6 @@ } \ } -#define PHP_FILTER_GET_LONG_OPT(zv, opt) { \ - if (Z_TYPE_P(zv) != IS_LONG) { \ - zval ___tmp; \ - ZVAL_DUP(&___tmp, zv); \ - convert_to_long(&___tmp); \ - opt = Z_LVAL(___tmp); \ - } else { \ - opt = Z_LVAL_P(zv); \ - } \ -} - #endif /* FILTER_PRIVATE_H */ /* diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c index c37df628d2..be1c2f0d40 100644 --- a/ext/filter/logical_filters.c +++ b/ext/filter/logical_filters.c @@ -41,7 +41,7 @@ var_name##_set = 0; \ if (option_array) { \ if ((option_val = zend_hash_str_find(HASH_OF(option_array), option_name, sizeof(option_name) - 1)) != NULL) { \ - PHP_FILTER_GET_LONG_OPT(option_val, var_name); \ + var_name = zval_get_long(option_val); \ var_name##_set = 1; \ } \ } @@ -80,7 +80,7 @@ #define FORMAT_IPV4 4 #define FORMAT_IPV6 6 -static int php_filter_parse_int(const char *str, unsigned int str_len, zend_long *ret TSRMLS_DC) { /* {{{ */ +static int php_filter_parse_int(const char *str, size_t str_len, zend_long *ret TSRMLS_DC) { /* {{{ */ zend_long ctx_value; int sign = 0, digit = 0; const char *end = str + str_len; @@ -132,7 +132,7 @@ static int php_filter_parse_int(const char *str, unsigned int str_len, zend_long } /* }}} */ -static int php_filter_parse_octal(const char *str, unsigned int str_len, zend_long *ret TSRMLS_DC) { /* {{{ */ +static int php_filter_parse_octal(const char *str, size_t str_len, zend_long *ret TSRMLS_DC) { /* {{{ */ zend_ulong ctx_value = 0; const char *end = str + str_len; @@ -155,7 +155,7 @@ static int php_filter_parse_octal(const char *str, unsigned int str_len, zend_lo } /* }}} */ -static int php_filter_parse_hex(const char *str, unsigned int str_len, zend_long *ret TSRMLS_DC) { /* {{{ */ +static int php_filter_parse_hex(const char *str, size_t str_len, zend_long *ret TSRMLS_DC) { /* {{{ */ zend_ulong ctx_value = 0; const char *end = str + str_len; zend_ulong n; @@ -188,7 +188,8 @@ void php_filter_int(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ zend_long min_range, max_range, option_flags; int min_range_set, max_range_set; int allow_octal = 0, allow_hex = 0; - int len, error = 0; + size_t len; + int error = 0; zend_long ctx_value; char *p; @@ -250,7 +251,7 @@ void php_filter_int(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ { char *str = Z_STRVAL_P(value); - int len = Z_STRLEN_P(value); + size_t len = Z_STRLEN_P(value); int ret; PHP_FILTER_TRIM_DEFAULT_EX(str, len, 0); @@ -318,12 +319,13 @@ void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ void php_filter_float(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ { - int len; + size_t len; char *str, *end; char *num, *p; zval *option_val; char *decimal; - int decimal_set, decimal_len; + int decimal_set; + size_t decimal_len; char dec_sep = '.'; char tsd_sep[3] = "',."; @@ -400,7 +402,7 @@ void php_filter_float(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ switch (is_numeric_string(num, p - num, &lval, &dval, 0)) { case IS_LONG: zval_ptr_dtor(value); - ZVAL_DOUBLE(value, lval); + ZVAL_DOUBLE(value, (double)lval); break; case IS_DOUBLE: if ((!dval && p - num > 1 && strpbrk(num, "123456789")) || !zend_finite(dval)) { @@ -443,7 +445,7 @@ void php_filter_validate_regexp(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ if (!re) { RETURN_VALIDATION_FAILED } - matches = pcre_exec(re, NULL, Z_STRVAL_P(value), Z_STRLEN_P(value), 0, 0, ovector, 3); + matches = pcre_exec(re, NULL, Z_STRVAL_P(value), (int)Z_STRLEN_P(value), 0, 0, ovector, 3); /* 0 means that the vector is too small to hold all the captured substring offsets */ if (matches < 0) { @@ -455,7 +457,7 @@ void php_filter_validate_regexp(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ { php_url *url; - int old_len = Z_STRLEN_P(value); + int old_len = (int)Z_STRLEN_P(value); php_filter_url(value, flags, option_array, charset TSRMLS_CC); @@ -554,7 +556,7 @@ void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ RETURN_VALIDATION_FAILED } zend_string_release(sregexp); - matches = pcre_exec(re, NULL, Z_STRVAL_P(value), Z_STRLEN_P(value), 0, 0, ovector, 3); + matches = pcre_exec(re, NULL, Z_STRVAL_P(value), (int)Z_STRLEN_P(value), 0, 0, ovector, 3); /* 0 means that the vector is too small to hold all the captured substring offsets */ if (matches < 0) { @@ -564,7 +566,7 @@ void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ } /* }}} */ -static int _php_filter_validate_ipv4(char *str, int str_len, int *ip) /* {{{ */ +static int _php_filter_validate_ipv4(char *str, size_t str_len, int *ip) /* {{{ */ { const char *end = str + str_len; int num, m; @@ -599,7 +601,7 @@ static int _php_filter_validate_ipv4(char *str, int str_len, int *ip) /* {{{ */ } /* }}} */ -static int _php_filter_validate_ipv6(char *str, int str_len TSRMLS_DC) /* {{{ */ +static int _php_filter_validate_ipv6(char *str, size_t str_len TSRMLS_DC) /* {{{ */ { int compressed = 0; int blocks = 0; @@ -792,8 +794,9 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ void php_filter_validate_mac(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ { char *input = Z_STRVAL_P(value); - int input_len = Z_STRLEN_P(value); - int tokens, length, i, offset, exp_separator_set, exp_separator_len; + size_t input_len = Z_STRLEN_P(value); + int tokens, length, i, offset, exp_separator_set; + size_t exp_separator_len; char separator; char *exp_separator; zend_long ret = 0; diff --git a/ext/filter/sanitizing_filters.c b/ext/filter/sanitizing_filters.c index 083b5382b6..851238fe45 100644 --- a/ext/filter/sanitizing_filters.c +++ b/ext/filter/sanitizing_filters.c @@ -30,7 +30,7 @@ typedef unsigned long filter_map[256]; static void php_filter_encode_html(zval *value, const unsigned char *chars) { smart_str str = {0}; - int len = Z_STRLEN_P(value); + size_t len = Z_STRLEN_P(value); unsigned char *s = (unsigned char *)Z_STRVAL_P(value); unsigned char *e = s + len; @@ -147,7 +147,7 @@ static void filter_map_init(filter_map *map) static void filter_map_update(filter_map *map, int flag, const unsigned char *allowed_list) { - int l, i; + size_t l, i; l = strlen((const char*)allowed_list); for (i = 0; i < l; ++i) { diff --git a/ext/filter/tests/filter_var_array_with_ref.phpt b/ext/filter/tests/filter_var_array_with_ref.phpt new file mode 100644 index 0000000000..cd202edf4d --- /dev/null +++ b/ext/filter/tests/filter_var_array_with_ref.phpt @@ -0,0 +1,23 @@ +--TEST-- +filter_var_array() on array with reference +--FILE-- +<?php + +$array = ["123foo"]; +$array2 = [&$array]; +var_dump(filter_var_array($array2, FILTER_VALIDATE_INT)); +var_dump($array); + +?> +--EXPECTF-- +array(1) { + [0]=> + &array(1) { + [0]=> + bool(false) + } +} +array(1) { + [0]=> + bool(false) +} diff --git a/ext/gd/gd.c b/ext/gd/gd.c index ade37aa575..5a820860e6 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -1539,14 +1539,7 @@ PHP_FUNCTION(imagesetstyle) stylearr = safe_emalloc(sizeof(int), zend_hash_num_elements(HASH_OF(styles)), 0); ZEND_HASH_FOREACH_VAL(HASH_OF(styles), item) { - if (Z_TYPE_P(item) != IS_LONG) { - zval lval; - ZVAL_COPY(&lval, item); - convert_to_long(&lval); - stylearr[index++] = Z_LVAL(lval); - } else { - stylearr[index++] = Z_LVAL_P(item); - } + stylearr[index++] = zval_get_long(item); } ZEND_HASH_FOREACH_END(); gdImageSetStyle(im, stylearr, index); @@ -3356,24 +3349,10 @@ static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled) for (i = 0; i < npoints; i++) { if ((var = zend_hash_index_find(Z_ARRVAL_P(POINTS), (i * 2))) != NULL) { - if (Z_TYPE_P(var) != IS_LONG) { - zval lval; - ZVAL_COPY(&lval, var); - convert_to_long(&lval); - points[i].x = Z_LVAL(lval); - } else { - points[i].x = Z_LVAL_P(var); - } + points[i].x = zval_get_long(var); } if ((var = zend_hash_index_find(Z_ARRVAL_P(POINTS), (i * 2) + 1)) != NULL) { - if (Z_TYPE_P(var) != IS_LONG) { - zval lval; - ZVAL_COPY(&lval, var); - convert_to_long(&lval); - points[i].y = Z_LVAL(lval); - } else { - points[i].y = Z_LVAL_P(var); - } + points[i].y = zval_get_long(var); } } @@ -3844,9 +3823,8 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int continue; } if (strcmp("linespacing", key->val) == 0) { - convert_to_double_ex(item); strex.flags |= gdFTEX_LINESPACE; - strex.linespacing = Z_DVAL_P(item); + strex.linespacing = zval_get_double(item); } } ZEND_HASH_FOREACH_END(); } @@ -4874,15 +4852,8 @@ PHP_FUNCTION(imageconvolution) } for (j=0; j<3; j++) { - if ((var2 = zend_hash_index_find(Z_ARRVAL_P(var), (j))) != NULL) { - if (Z_TYPE_P(var2) != IS_DOUBLE) { - zval dval; - ZVAL_COPY(&dval, var2); - convert_to_double(&dval); - matrix[i][j] = (float)Z_DVAL(dval); - } else { - matrix[i][j] = (float)Z_DVAL_P(var2); - } + 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"); RETURN_FALSE; @@ -4975,56 +4946,28 @@ PHP_FUNCTION(imagecrop) ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "x", sizeof("x") -1)) != NULL) { - if (Z_TYPE_P(tmp) != IS_LONG) { - zval lval; - ZVAL_COPY(&lval, tmp); - convert_to_long(&lval); - rect.x = Z_LVAL(lval); - } else { - rect.x = Z_LVAL_P(tmp); - } + rect.x = zval_get_long(tmp); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing x position"); RETURN_FALSE; } if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "y", sizeof("y") - 1)) != NULL) { - if (Z_TYPE_P(tmp) != IS_LONG) { - zval lval; - ZVAL_COPY(&lval, tmp); - convert_to_long(&lval); - rect.y = Z_LVAL(lval); - } else { - rect.y = Z_LVAL_P(tmp); - } + rect.y = zval_get_long(tmp); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing y position"); RETURN_FALSE; } if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "width", sizeof("width") - 1)) != NULL) { - if (Z_TYPE_P(tmp) != IS_LONG) { - zval lval; - ZVAL_COPY(&lval, tmp); - convert_to_long(&lval); - rect.width = Z_LVAL(lval); - } else { - rect.width = Z_LVAL_P(tmp); - } + rect.width = zval_get_long(tmp); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing width"); RETURN_FALSE; } if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "height", sizeof("height") - 1)) != NULL) { - if (Z_TYPE_P(tmp) != IS_LONG) { - zval lval; - ZVAL_COPY(&lval, tmp); - convert_to_long(&lval); - rect.height = Z_LVAL(lval); - } else { - rect.height = Z_LVAL_P(tmp); - } + rect.height = zval_get_long(tmp); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing height"); RETURN_FALSE; @@ -5103,11 +5046,23 @@ PHP_FUNCTION(imagescale) return; } method = tmp_m; - new_width = tmp_w; - new_height = tmp_h; ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); + if (tmp_h < 0) { + /* preserve ratio */ + long src_x, src_y; + + src_x = gdImageSX(im); + src_y = gdImageSY(im); + if (src_x) { + tmp_h = tmp_w * src_y / src_x; + } + } + + new_width = tmp_w; + new_height = tmp_h; + if (gdImageSetInterpolationMethod(im, method)) { im_scaled = gdImageScale(im, new_width, new_height); } @@ -5157,12 +5112,7 @@ PHP_FUNCTION(imageaffine) affine[i] = Z_DVAL_P(zval_affine_elem); break; case IS_STRING: - { - zval dval; - ZVAL_COPY(&dval, zval_affine_elem); - convert_to_double(&dval); - affine[i] = Z_DVAL(dval); - } + affine[i] = zval_get_double(zval_affine_elem); break; default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type for element %i", i); @@ -5173,56 +5123,28 @@ PHP_FUNCTION(imageaffine) if (z_rect != NULL) { if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "x", sizeof("x") - 1)) != NULL) { - if (Z_TYPE_P(tmp) != IS_LONG) { - zval lval; - ZVAL_COPY(&lval, tmp); - convert_to_long(&lval); - rect.x = Z_LVAL(lval); - } else { - rect.x = Z_LVAL_P(tmp); - } + rect.x = zval_get_long(tmp); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing x position"); RETURN_FALSE; } if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "y", sizeof("y") - 1)) != NULL) { - if (Z_TYPE_P(tmp) != IS_LONG) { - zval lval; - ZVAL_COPY(&lval, tmp); - convert_to_long(&lval); - rect.y = Z_LVAL(lval); - } else { - rect.y = Z_LVAL_P(tmp); - } + rect.y = zval_get_long(tmp); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing y position"); RETURN_FALSE; } if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "width", sizeof("width") - 1)) != NULL) { - if (Z_TYPE_P(tmp) != IS_LONG) { - zval lval; - ZVAL_COPY(&lval, tmp); - convert_to_long(&lval); - rect.width = Z_LVAL(lval); - } else { - rect.width = Z_LVAL_P(tmp); - } + rect.width = zval_get_long(tmp); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing width"); RETURN_FALSE; } if ((tmp = zend_hash_str_find(HASH_OF(z_rect), "height", sizeof("height") - 1)) != NULL) { - if (Z_TYPE_P(tmp) != IS_LONG) { - zval lval; - ZVAL_COPY(&lval, tmp); - convert_to_long(&lval); - rect.height = Z_LVAL(lval); - } else { - rect.height = Z_LVAL_P(tmp); - } + rect.height = zval_get_long(tmp); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing height"); RETURN_FALSE; @@ -5271,28 +5193,14 @@ PHP_FUNCTION(imageaffinematrixget) RETURN_FALSE; } if ((tmp = zend_hash_str_find(HASH_OF(options), "x", sizeof("x") - 1)) != NULL) { - if (Z_TYPE_P(tmp) != IS_DOUBLE) { - zval dval; - ZVAL_COPY(&dval, tmp); - convert_to_double(&dval); - x = Z_DVAL(dval); - } else { - x = Z_DVAL_P(tmp); - } + x = zval_get_double(tmp); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing x position"); RETURN_FALSE; } if ((tmp = zend_hash_str_find(HASH_OF(options), "y", sizeof("y") - 1)) != NULL) { - if (Z_TYPE_P(tmp) != IS_DOUBLE) { - zval dval; - ZVAL_COPY(&dval, tmp); - convert_to_double(&dval); - y = Z_DVAL(dval); - } else { - y = Z_DVAL_P(tmp); - } + y = zval_get_double(tmp); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing y position"); RETURN_FALSE; @@ -5315,8 +5223,8 @@ PHP_FUNCTION(imageaffinematrixget) php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number is expected as option"); RETURN_FALSE; } - convert_to_double_ex(options); - angle = Z_DVAL_P(options); + + angle = zval_get_double(options); if (type == GD_AFFINE_SHEAR_HORIZONTAL) { res = gdAffineShearHorizontal(affine, angle); @@ -5375,12 +5283,7 @@ PHP_FUNCTION(imageaffinematrixconcat) m1[i] = Z_DVAL_P(tmp); break; case IS_STRING: - { - zval dval; - ZVAL_COPY(&dval, tmp); - convert_to_double(&dval); - m1[i] = Z_DVAL(dval); - } + m1[i] = zval_get_double(tmp); break; default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type for element %i", i); @@ -5396,12 +5299,7 @@ PHP_FUNCTION(imageaffinematrixconcat) m2[i] = Z_DVAL_P(tmp); break; case IS_STRING: - { - zval dval; - ZVAL_COPY(&dval, tmp); - convert_to_double(&dval); - m2[i] = Z_DVAL(dval); - } + m2[i] = zval_get_double(tmp); break; default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type for element %i", i); diff --git a/ext/gd/gd.dsp b/ext/gd/gd.dsp deleted file mode 100644 index c5ec5aaf7d..0000000000 --- a/ext/gd/gd.dsp +++ /dev/null @@ -1,600 +0,0 @@ -# Microsoft Developer Studio Project File - Name="gd" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=gd - Win32 Release_TS GD2
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "gd.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "gd.mak" CFG="gd - Win32 Release_TS GD2"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "gd - Win32 Release_TS GD2" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "gd - Win32 Debug_TS GD2" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "gd___Win32_Release_TS_GD2_bundled"
-# PROP BASE Intermediate_Dir "gd___Win32_Release_TS_GD2_bundled"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=0 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php7ts.lib libjpeg.lib libpng.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gd2.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-# SUBTRACT BASE LINK32 /pdb:none
-# ADD LINK32 php7ts.lib freetype2.lib libjpeg.lib libpng.lib zlib.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gd2.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\zlib\Release"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "gd___Win32_Debug_TS_GD2_bundled"
-# PROP BASE Intermediate_Dir "gd___Win32_Debug_TS_GD2_bundled"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=1 /D "HAVE_LIBGD15" /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php7ts_debug.lib libjpeg.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_gd2.dll" /libpath:"..\..\Debug_TS"
-# SUBTRACT BASE LINK32 /pdb:none
-# ADD LINK32 php7ts_debug.lib libpng.lib zlib.lib libjpeg.lib freetype2.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_gd2.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\zlib\Debug"
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF
-
-# Begin Target
-
-# Name "gd - Win32 Release_TS GD2"
-# Name "gd - Win32 Debug_TS GD2"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\gd.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\gdttf.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\gdcache.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\gdttf.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_gd.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# Begin Group "libgd"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 1"
-
-# PROP Default_Filter "*.c"
-# Begin Source File
-
-SOURCE=.\libgd\gd.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd2copypal.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_arc_f_buggy.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_gd.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_gd2.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_gif_in.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_gif_out.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_io.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_io_dp.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_io_file.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_io_ss.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_jpeg.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_png.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_ss.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_topal.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_wbmp.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdcache.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdfontg.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdfontl.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdfontmb.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdfonts.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdfontt.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdft.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdhelpers.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdkanji.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdtables.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdxpm.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\wbmp.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\xbm.c
-
-!IF "$(CFG)" == "gd - Win32 Release_TS GD2"
-
-# PROP Intermediate_Dir "Release_TS_bundled"
-
-!ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2"
-
-# PROP Intermediate_Dir "Debug_TS_bundled"
-
-!ENDIF
-
-# End Source File
-# End Group
-# Begin Group "Header Files No. 1"
-
-# PROP Default_Filter "*.h"
-# Begin Source File
-
-SOURCE=.\libgd\gd.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gd_io.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdcache.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdfontg.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdfontl.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdfontmb.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdfonts.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdfontt.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\gdhelpers.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\jisx0208.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libgd\wbmp.h
-# End Source File
-# End Group
-# End Group
-# End Target
-# End Project
diff --git a/ext/gettext/gettext.dsp b/ext/gettext/gettext.dsp deleted file mode 100644 index 4daddf3ab6..0000000000 --- a/ext/gettext/gettext.dsp +++ /dev/null @@ -1,113 +0,0 @@ -# Microsoft Developer Studio Project File - Name="gettext" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=gettext - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "gettext.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "gettext.mak" CFG="gettext - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "gettext - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "gettext - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "gettext - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_GETTEXT" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GETTEXT_EXPORTS" /D "COMPILE_DL_GETTEXT" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LIBINTL=1 /D HAVE_BIND_TEXTDOMAIN_CODESET=1 /D HAVE_NGETTEXT=1 /D HAVE_DNGETTEXT=1 /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gettext.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-# ADD LINK32 php7ts.lib libintl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gettext.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "gettext - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_GETTEXT" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D HAVE_NGETTEXT=1 /D HAVE_DNGETTEXT=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GETTEXT_EXPORTS" /D "COMPILE_DL_GETTEXT" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LIBINTL=1 /D HAVE_BIND_TEXTDOMAIN_CODESET=1 /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib /nologo /dll /machine:I386 /out:"../../Debug_TS/php_gettext.dll" /libpath:"..\..\Debug_TS"
-# ADD LINK32 php7ts_debug.lib libintl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"../../Debug_TS/php_gettext.dll" /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "gettext - Win32 Release_TS"
-# Name "gettext - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\gettext.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_gettext.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/gmp/config.m4 b/ext/gmp/config.m4 index 2140aaf701..0388d548cf 100644 --- a/ext/gmp/config.m4 +++ b/ext/gmp/config.m4 @@ -1,7 +1,3 @@ -dnl -dnl $Id$ -dnl - PHP_ARG_WITH(gmp, for GNU MP support, [ --with-gmp[=DIR] Include GNU MP support]) @@ -15,14 +11,9 @@ if test "$PHP_GMP" != "no"; then AC_MSG_ERROR(Unable to locate gmp.h) fi - PHP_CHECK_LIBRARY(gmp, __gmp_randinit_lc_2exp_size, + PHP_CHECK_LIBRARY(gmp, __gmpz_rootrem, [],[ - PHP_CHECK_LIBRARY(gmp, gmp_randinit_lc_2exp_size, - [],[ - AC_MSG_ERROR([GNU MP Library version 4.1.2 or greater required.]) - ],[ - -L$GMP_DIR/$PHP_LIBDIR - ]) + AC_MSG_ERROR([GNU MP Library version 4.2 or greater required.]) ],[ -L$GMP_DIR/$PHP_LIBDIR ]) diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index 18e7965199..d5d9f14c4b 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -104,6 +104,15 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_random, 0, 0, 0) ZEND_ARG_INFO(0, limiter) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_random_bits, 0, 0, 1) + ZEND_ARG_INFO(0, bits) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_random_range, 0, 0, 2) + ZEND_ARG_INFO(0, min) + ZEND_ARG_INFO(0, max) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_setbit, 0, 0, 2) ZEND_ARG_INFO(0, a) ZEND_ARG_INFO(0, index) @@ -161,6 +170,8 @@ const zend_function_entry gmp_functions[] = { ZEND_FE(gmp_cmp, arginfo_gmp_binary) ZEND_FE(gmp_sign, arginfo_gmp_unary) ZEND_FE(gmp_random, arginfo_gmp_random) + ZEND_FE(gmp_random_bits, arginfo_gmp_random_bits) + ZEND_FE(gmp_random_range, arginfo_gmp_random_range) ZEND_FE(gmp_and, arginfo_gmp_binary) ZEND_FE(gmp_or, arginfo_gmp_binary) ZEND_FE(gmp_com, arginfo_gmp_unary) @@ -224,16 +235,7 @@ typedef struct _gmp_temp { #define GMP_BIG_ENDIAN (1 << 3) #define GMP_NATIVE_ENDIAN (1 << 4) -#define GMP_42_OR_NEWER \ - ((__GNU_MP_VERSION >= 5) || (__GNU_MP_VERSION >= 4 && __GNU_MP_VERSION_MINOR >= 2)) - -/* The maximum base for input and output conversions is 62 from GMP 4.2 - * onwards. */ -#if GMP_42_OR_NEWER -# define MAX_BASE 62 -#else -# define MAX_BASE 36 -#endif +#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)) @@ -357,30 +359,6 @@ 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) -/* {{{ gmp_emalloc - */ -static void *gmp_emalloc(size_t size) -{ - return emalloc(size); -} -/* }}} */ - -/* {{{ gmp_erealloc - */ -static void *gmp_erealloc(void *ptr, size_t old_size, size_t new_size) -{ - return erealloc(ptr, new_size); -} -/* }}} */ - -/* {{{ gmp_efree - */ -static void gmp_efree(void *ptr, size_t size) -{ - efree(ptr); -} -/* }}} */ - static void gmp_free_object_storage(zend_object *obj TSRMLS_DC) /* {{{ */ { gmp_object *intern = GET_GMP_OBJECT_FROM_OBJ(obj); @@ -685,8 +663,6 @@ ZEND_MINIT_FUNCTION(gmp) REGISTER_LONG_CONSTANT("GMP_BIG_ENDIAN", GMP_BIG_ENDIAN, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("GMP_NATIVE_ENDIAN", GMP_NATIVE_ENDIAN, CONST_CS | CONST_PERSISTENT); - mp_set_memory_functions(gmp_emalloc, gmp_erealloc, gmp_efree); - return SUCCESS; } /* }}} */ @@ -1048,8 +1024,8 @@ ZEND_FUNCTION(gmp_init) return; } - if (base && (base < 2 || base > MAX_BASE)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %pd (should be between 2 and %d)", base, MAX_BASE); + 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); RETURN_FALSE; } @@ -1204,15 +1180,10 @@ ZEND_FUNCTION(gmp_strval) return; } -#if MAX_BASE == 62 - /* Although the maximum base in general in GMP >= 4.2 is 62, mpz_get_str() + /* 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 > 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, MAX_BASE); -#else - if (base < 2 || base > MAX_BASE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %pd (should be between 2 and %d)", base, MAX_BASE); -#endif + 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); RETURN_FALSE; } @@ -1596,14 +1567,7 @@ ZEND_FUNCTION(gmp_rootrem) add_next_index_zval(return_value, &result1); add_next_index_zval(return_value, &result2); -#if GMP_42_OR_NEWER mpz_rootrem(gmpnum_result1, gmpnum_result2, gmpnum_a, (gmp_ulong) nth); -#else - mpz_root(gmpnum_result1, gmpnum_a, (gmp_ulong) nth); - mpz_pow_ui(gmpnum_result2, gmpnum_result1, (gmp_ulong) nth); - mpz_sub(gmpnum_result2, gmpnum_a, gmpnum_result2); - mpz_abs(gmpnum_result2, gmpnum_result2); -#endif FREE_GMP_TEMP(temp_a); } @@ -1764,6 +1728,18 @@ ZEND_FUNCTION(gmp_sign) } /* }}} */ +static void gmp_init_random(TSRMLS_D) +{ + if (!GMPG(rand_initialized)) { + /* Initialize */ + gmp_randinit_mt(GMPG(rand_state)); + /* Seed */ + gmp_randseed_ui(GMPG(rand_state), GENERATE_SEED()); + + GMPG(rand_initialized) = 1; + } +} + /* {{{ proto GMP gmp_random([int limiter]) Gets random number */ ZEND_FUNCTION(gmp_random) @@ -1776,16 +1752,8 @@ ZEND_FUNCTION(gmp_random) } INIT_GMP_RETVAL(gmpnum_result); + gmp_init_random(TSRMLS_C); - if (!GMPG(rand_initialized)) { - /* Initialize */ - gmp_randinit_lc_2exp_size(GMPG(rand_state), 32L); - - /* Seed */ - gmp_randseed_ui(GMPG(rand_state), GENERATE_SEED()); - - GMPG(rand_initialized) = 1; - } #ifdef GMP_LIMB_BITS mpz_urandomb(gmpnum_result, GMPG(rand_state), GMP_ABS (limiter) * GMP_LIMB_BITS); #else @@ -1794,6 +1762,91 @@ ZEND_FUNCTION(gmp_random) } /* }}} */ +/* {{{ proto GMP gmp_random_bits(int bits) + Gets a random number in the range 0 to (2 ** n) - 1 */ +ZEND_FUNCTION(gmp_random_bits) +{ + zend_long bits; + mpz_ptr gmpnum_result; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &bits) == FAILURE) { + return; + } + + if (bits <= 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The number of bits must be positive"); + RETURN_FALSE; + } + + INIT_GMP_RETVAL(gmpnum_result); + gmp_init_random(TSRMLS_C); + + mpz_urandomb(gmpnum_result, GMPG(rand_state), bits); +} +/* }}} */ + +/* {{{ proto GMP gmp_random_range(mixed min, mixed max) + Gets a random number in the range min to max */ +ZEND_FUNCTION(gmp_random_range) +{ + zval *min_arg, *max_arg; + 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) { + return; + } + + gmp_init_random(TSRMLS_C); + + 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"); + RETURN_FALSE; + } + + INIT_GMP_RETVAL(gmpnum_result); + + if (Z_LVAL_P(min_arg)) { + mpz_sub_ui(gmpnum_max, gmpnum_max, Z_LVAL_P(min_arg)); + } + + mpz_add_ui(gmpnum_max, gmpnum_max, 1); + mpz_urandomm(gmpnum_result, GMPG(rand_state), gmpnum_max); + + if (Z_LVAL_P(min_arg)) { + mpz_add_ui(gmpnum_result, gmpnum_result, Z_LVAL_P(min_arg)); + } + + FREE_GMP_TEMP(temp_a); + + } + else { + FETCH_GMP_ZVAL_DEP(gmpnum_min, min_arg, temp_b, temp_a); + + 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"); + RETURN_FALSE; + } + + INIT_GMP_RETVAL(gmpnum_result); + + mpz_sub(gmpnum_max, gmpnum_max, gmpnum_min); + mpz_add_ui(gmpnum_max, gmpnum_max, 1); + mpz_urandomm(gmpnum_result, GMPG(rand_state), gmpnum_max); + mpz_add(gmpnum_result, gmpnum_result, gmpnum_min); + + FREE_GMP_TEMP(temp_b); + FREE_GMP_TEMP(temp_a); + } +} +/* }}} */ + /* {{{ proto GMP gmp_and(mixed a, mixed b) Calculates logical AND of a and b */ ZEND_FUNCTION(gmp_and) @@ -1849,7 +1902,7 @@ ZEND_FUNCTION(gmp_setbit) if (index < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Index must be greater than or equal to zero"); - return; + RETURN_FALSE; } gmpnum_a = GET_GMP_FROM_ZVAL(a_arg); @@ -1876,7 +1929,7 @@ ZEND_FUNCTION(gmp_clrbit) if (index < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Index must be greater than or equal to zero"); - return; + RETURN_FALSE; } gmpnum_a = GET_GMP_FROM_ZVAL(a_arg); diff --git a/ext/gmp/php_gmp.h b/ext/gmp/php_gmp.h index 59485dd5b7..f9bc0f3269 100644 --- a/ext/gmp/php_gmp.h +++ b/ext/gmp/php_gmp.h @@ -66,6 +66,8 @@ ZEND_FUNCTION(gmp_or); ZEND_FUNCTION(gmp_com); ZEND_FUNCTION(gmp_xor); ZEND_FUNCTION(gmp_random); +ZEND_FUNCTION(gmp_random_bits); +ZEND_FUNCTION(gmp_random_range); ZEND_FUNCTION(gmp_setbit); ZEND_FUNCTION(gmp_clrbit); ZEND_FUNCTION(gmp_scan0); diff --git a/ext/gmp/tests/bug50283.phpt b/ext/gmp/tests/bug50283.phpt index 13eef54804..561cd3d68c 100644 --- a/ext/gmp/tests/bug50283.phpt +++ b/ext/gmp/tests/bug50283.phpt @@ -2,7 +2,6 @@ Feature Request #50283 (allow base in gmp_strval to use full range: 2 to 62, and -2 to -36) --SKIPIF-- <?php if (!extension_loaded("gmp")) print "skip"; ?> -<?php if (version_compare(GMP_VERSION, "4.2.0", "<")) print "skip"; ?> --FILE-- <?php $a = gmp_init("0x41682179fbf5"); diff --git a/ext/gmp/tests/gmp_clrbit.phpt b/ext/gmp/tests/gmp_clrbit.phpt index 079d5d669f..0aab89dd37 100644 --- a/ext/gmp/tests/gmp_clrbit.phpt +++ b/ext/gmp/tests/gmp_clrbit.phpt @@ -10,7 +10,7 @@ gmp_clrbit($n, 0); var_dump(gmp_strval($n)); $n = gmp_init(-1); -gmp_clrbit($n, -1); +var_dump(gmp_clrbit($n, -1)); var_dump(gmp_strval($n)); $n = gmp_init("1000000"); @@ -35,10 +35,11 @@ gmp_clrbit(); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- string(1) "0" Warning: gmp_clrbit(): Index must be greater than or equal to zero in %s on line %d +bool(false) string(2) "-1" Warning: gmp_clrbit(): Index must be greater than or equal to zero in %s on line %d diff --git a/ext/gmp/tests/gmp_random_bits.phpt b/ext/gmp/tests/gmp_random_bits.phpt new file mode 100644 index 0000000000..21d493cdb6 --- /dev/null +++ b/ext/gmp/tests/gmp_random_bits.phpt @@ -0,0 +1,45 @@ +--TEST-- +gmp_random_bits() basic tests +--SKIPIF-- +<?php if (!extension_loaded("gmp")) print "skip"; ?> +--FILE-- +<?php + +var_dump(gmp_random_bits()); +var_dump(gmp_random_bits(0)); +var_dump(gmp_random_bits(-1)); + +// If these error the test fails. +gmp_random_bits(1); +gmp_random_bits(1024); + +// 2 seconds to make sure the numbers stay in range +$start = microtime(true); +$limit = (2 ** 30) - 1; +while (1) { + for ($i = 0; $i < 5000; $i++) { + $result = gmp_random_bits(30); + if ($result < 0 || $result > $limit) { + print "RANGE VIOLATION\n"; + var_dump($result); + break 2; + } + } + + if (microtime(true) - $start > 2) { + break; + } +} + +echo "Done\n"; +?> +--EXPECTF-- +Warning: gmp_random_bits() expects exactly 1 parameter, 0 given in %s on line %d +NULL + +Warning: gmp_random_bits(): The number of bits must be positive in %s on line %d +bool(false) + +Warning: gmp_random_bits(): The number of bits must be positive in %s on line %d +bool(false) +Done diff --git a/ext/gmp/tests/gmp_random_range.phpt b/ext/gmp/tests/gmp_random_range.phpt new file mode 100644 index 0000000000..a8e7c4a9c1 --- /dev/null +++ b/ext/gmp/tests/gmp_random_range.phpt @@ -0,0 +1,81 @@ +--TEST-- +gmp_random_range() basic tests +--SKIPIF-- +<?php if (!extension_loaded("gmp")) print "skip"; ?> +--FILE-- +<?php + +$minusTen = gmp_init(-1); +$plusTen = gmp_init(1); +$zero = gmp_init(0); + +var_dump(gmp_random_range()); +var_dump(gmp_random_range(10)); +var_dump(gmp_random_range(10, -10)); + +var_dump(gmp_random_range($plusTen, $minusTen)); +var_dump(gmp_random_range($plusTen, $zero)); + +// If these error the test fails. +gmp_random_range(0, 10); +gmp_random_range(1, 10); +gmp_random_range(-1, 10); +gmp_random_range(-10, 0); +gmp_random_range(-10, -1); + +gmp_random_range(0, $plusTen); +gmp_random_range(1, $plusTen); +gmp_random_range(-1, $plusTen); + +gmp_random_range($zero, $plusTen); +gmp_random_range($minusTen, $plusTen); + +// 2 seconds to make sure the numbers stay in range +$start = microtime(true); +while (1) { + for ($i = 0; $i < 5000; $i++) { + $result = gmp_random_range(0, 1000); + if ($result < 0 || $result > 1000) { + print "RANGE VIOLATION 1\n"; + var_dump($result); + break 2; + } + + $result = gmp_random_range(-1000, 0); + if ($result < -1000 || $result > 0) { + print "RANGE VIOLATION 2\n"; + var_dump($result); + break 2; + } + + $result = gmp_random_range(-500, 500); + if ($result < -500 || $result > 500) { + print "RANGE VIOLATION 3\n"; + var_dump($result); + break 2; + } + } + + if (microtime(true) - $start > 2) { + break; + } +} + +echo "Done\n"; +?> +--EXPECTF-- +Warning: gmp_random_range() expects exactly 2 parameters, 0 given in %s on line %d +NULL + +Warning: gmp_random_range() expects exactly 2 parameters, 1 given in %s on line %d +NULL + +Warning: gmp_random_range(): The minimum value must be less than the maximum value in %s on line %d +bool(false) + +Warning: gmp_random_range(): The minimum value must be less than the maximum value in %s on line %d +bool(false) + +Warning: gmp_random_range(): The minimum value must be less than the maximum value in %s on line %d +bool(false) +Done diff --git a/ext/gmp/tests/gmp_setbit.phpt b/ext/gmp/tests/gmp_setbit.phpt index 99848959d5..2eac23db0e 100644 --- a/ext/gmp/tests/gmp_setbit.phpt +++ b/ext/gmp/tests/gmp_setbit.phpt @@ -10,7 +10,7 @@ gmp_setbit($n, 10, -1); var_dump(gmp_strval($n)); $n = gmp_init(5); -gmp_setbit($n, -20, 0); +var_dump(gmp_setbit($n, -20, 0)); var_dump(gmp_strval($n)); $n = gmp_init(5); @@ -41,10 +41,11 @@ gmp_setbit($a,array()); echo "Done\n"; ?> ---EXPECTF-- +--EXPECTF-- string(2) "-1" Warning: gmp_setbit(): Index must be greater than or equal to zero in %s on line %d +bool(false) string(1) "5" string(1) "1" string(1) "7" diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index d425f6cf1e..a4581e9fad 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -408,7 +408,7 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c mimetype = SG(sapi_headers).mimetype; } else { mimetype = SG(sapi_headers).mimetype; - mimetype_len = s - SG(sapi_headers).mimetype; + mimetype_len = (int)(s - SG(sapi_headers).mimetype); } } else if (SG(sapi_headers).send_default_content_type) { mimetype = SG(default_mimetype) ? SG(default_mimetype) : SAPI_DEFAULT_MIMETYPE; @@ -423,7 +423,7 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c } 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)); } - if (content_type && SUCCESS == sapi_add_header(content_type, len, 0)) { + 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); } @@ -2300,7 +2300,7 @@ PHP_FUNCTION(iconv_mime_decode) RETURN_FALSE; } - err = _php_iconv_mime_decode(&retval, encoded_str->val, encoded_str->len, charset, NULL, mode); + err = _php_iconv_mime_decode(&retval, encoded_str->val, encoded_str->len, charset, NULL, (int)mode); _php_iconv_show_error(err, charset, "???" TSRMLS_CC); if (err == PHP_ICONV_ERR_SUCCESS) { @@ -2353,7 +2353,7 @@ PHP_FUNCTION(iconv_mime_decode_headers) char *p, *limit; const char *next_pos; - if (PHP_ICONV_ERR_SUCCESS != (err = _php_iconv_mime_decode(&decoded_header, enc_str_tmp, enc_str_len_tmp, charset, &next_pos, mode))) { + if (PHP_ICONV_ERR_SUCCESS != (err = _php_iconv_mime_decode(&decoded_header, enc_str_tmp, enc_str_len_tmp, charset, &next_pos, (int)mode))) { smart_str_free(&decoded_header); break; } diff --git a/ext/iconv/iconv.dsp b/ext/iconv/iconv.dsp deleted file mode 100644 index f9890f0dcd..0000000000 --- a/ext/iconv/iconv.dsp +++ /dev/null @@ -1,107 +0,0 @@ -# Microsoft Developer Studio Project File - Name="iconv" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=iconv - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "iconv.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "iconv.mak" CFG="iconv - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "iconv - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "iconv - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "iconv - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ICONV_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\win32" /I "..\..\..\php_build\iconv\include" /D "WIN32" /D "PHP_EXPORTS" /D "COMPILE_DL_ICONV" /D "HAVE_ICONV" /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZTS=1 /D "ICONV_SUPPORTS_ERRNO" /D "HAVE_LIBICONV" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php7ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_iconv.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "iconv - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ICONV_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\win32" /I "..\..\..\php_build\iconv\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_ICONV" /D "ZEND_WIN32" /D "PHP_WIN32" /D "HAVE_ICONV" /D ZTS=1 /D "HAVE_LIBICONV" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php7ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_iconv.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "iconv - Win32 Release_TS"
-# Name "iconv - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\iconv.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_iconv.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/imap/imap.dsp b/ext/imap/imap.dsp deleted file mode 100644 index c757bf61e9..0000000000 --- a/ext/imap/imap.dsp +++ /dev/null @@ -1,176 +0,0 @@ -# Microsoft Developer Studio Project File - Name="imap" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=imap - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "imap.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "imap.mak" CFG="imap - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "imap - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "imap - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "imap - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "imap - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "imap - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMAP_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\IMAP\c-client" /I "..\..\TSRM" /D "NDEBUG" /D "IMAP_EXPORTS" /D "COMPILE_DL_IMAP" /D HAVE_IMAP=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=0 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "NDEBUG"
-# ADD RSC /l 0x40d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7nts.lib wsock32.lib winmm.lib cclient.lib /nologo /dll /machine:I386 /out:"Release/php_imap.dll" /libpath:"..\..\Release" /libpath:"..\..\..\php_build\IMAP\C-Client"
-
-!ELSEIF "$(CFG)" == "imap - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMAP_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\php_build\IMAP\c-client" /I "..\..\TSRM" /D "_DEBUG" /D "IMAP_EXPORTS" /D "COMPILE_DL_IMAP" /D HAVE_IMAP=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=1 /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "_DEBUG"
-# ADD RSC /l 0x40d /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7nts_debug.lib wsock32.lib winmm.lib cclient.lib /nologo /dll /debug /machine:I386 /out:"Debug/php_imap.dll" /pdbtype:sept /libpath:"..\..\Debug" /libpath:"..\..\..\php_build\IMAP\C-Client"
-
-!ELSEIF "$(CFG)" == "imap - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMAP_EXPORTS" /FR /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\\" /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "ZTS" /D "_DEBUG" /D "IMAP_EXPORTS" /D "COMPILE_DL_IMAP" /D HAVE_IMAP=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=1 /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "_DEBUG"
-# ADD RSC /l 0x40d /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts_debug.lib wsock32.lib winmm.lib cclient.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_imap.dll" /pdbtype:sept /libpath:"..\..\..\\" /libpath:"..\..\Debug_TS"
-
-!ELSEIF "$(CFG)" == "imap - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "IMAP_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\\" /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\imap\c-client" /D "ZTS" /D "NDEBUG" /D "IMAP_EXPORTS" /D "COMPILE_DL_IMAP" /D HAVE_IMAP=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=0 /D HAVE_IMAP2001=1 /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "NDEBUG"
-# ADD RSC /l 0x40d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib wsock32.lib winmm.lib cclient.lib Secur32.lib CertIdl.Lib /nologo /dll /machine:I386 /nodefaultlib:"LIBCMT" /out:"..\..\Release_TS/php_imap.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\imap"
-# SUBTRACT LINK32 /nodefaultlib
-
-!ENDIF
-
-# Begin Target
-
-# Name "imap - Win32 Release"
-# Name "imap - Win32 Debug"
-# Name "imap - Win32 Debug_TS"
-# Name "imap - Win32 Release_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\php_imap.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\win32\sendmail.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_imap.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\win32\sendmail.h
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=.\IMAP_Win32_HOWTO.txt
-# End Source File
-# End Target
-# End Project
diff --git a/ext/interbase/interbase.dsp b/ext/interbase/interbase.dsp deleted file mode 100644 index 9197dab371..0000000000 --- a/ext/interbase/interbase.dsp +++ /dev/null @@ -1,135 +0,0 @@ -# Microsoft Developer Studio Project File - Name="interbase" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=interbase - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "interbase.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "interbase.mak" CFG="interbase - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "interbase - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "interbase - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName "interbase"
-# PROP Scc_LocalPath "."
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "interbase - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\Interbase SDK\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "INTERBASE_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=1 /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\Interbase SDK\include" /I "..\..\..\bindlib_w32" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "INTERBASE_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_IBASE=1 /D "COMPILE_DL_INTERBASE" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "_DEBUG"
-# ADD RSC /l 0x40d /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ib_util_ms.lib gds32_ms.lib php7ts_debug.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts_debug.lib gds32_ms.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_interbase.dll" /pdbtype:sept /libpath:"..\..\..\php_build\Interbase SDK\lib_ms" /libpath:"..\..\Debug_TS"
-
-!ELSEIF "$(CFG)" == "interbase - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\Interbase SDK\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "INTERBASE_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_IBASE=1 /D ZEND_DEBUG=0 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\main" /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\Interbase SDK\include" /I "..\..\..\bindlib_w32" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "INTERBASE_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_IBASE=1 /D "COMPILE_DL_INTERBASE" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "NDEBUG"
-# ADD RSC /l 0x40d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php7ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ib_util_ms.lib gds32_ms.lib /nologo /dll /machine:I386
-# ADD LINK32 php7ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib gds32_ms.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_interbase.dll" /libpath:"..\..\..\php_build\Interbase SDK\lib_ms" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ENDIF
-
-# Begin Target
-
-# Name "interbase - Win32 Debug_TS"
-# Name "interbase - Win32 Release_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\ibase_blobs.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\ibase_events.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\ibase_query.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\ibase_service.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\interbase.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_interbase.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# Begin Source File
-
-SOURCE=.\interbase.rc
-# ADD BASE RSC /l 0x413
-# ADD RSC /l 0x413 /i "..\..\main" /i "..\..\win32" /d "PHP_H"
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/json/json.c b/ext/json/json.c index 16e452a004..8f4f281ef1 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -571,7 +571,7 @@ 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); + zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Failed calling %s::jsonSerialize()", ce->name->val); smart_str_appendl(buf, "null", sizeof("null") - 1); zval_ptr_dtor(&fname); return; diff --git a/ext/json/json.dsp b/ext/json/json.dsp deleted file mode 100644 index e5bb3767bf..0000000000 --- a/ext/json/json.dsp +++ /dev/null @@ -1,135 +0,0 @@ -# Microsoft Developer Studio Project File - Name="json" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=json - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "json.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "json.mak" CFG="json - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "json - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "json - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "json - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JSON_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "json_c" /D HAVE_JSON=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=1 /D ZTS=1 /D COMPILE_DL_JSON=1 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JSON_EXPORTS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x1009 /d "_DEBUG"
-# ADD RSC /l 0x1009 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 iconv.lib php4ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_json.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ELSEIF "$(CFG)" == "json - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JSON_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "json_c" /D HAVE_JSON=1 /D "ZEND_WIN32" /D ZEND_DEBUG=0 /D "PHP_WIN32" /D ZTS=1 /D COMPILE_DL_JSON=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JSON_EXPORTS" /D "HAVE_FCNTL_H" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x1009 /d "NDEBUG"
-# ADD RSC /l 0x1009 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 iconv.lib php4ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_json.dll" /libpath:"..\..\Release_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "json - Win32 Debug_TS"
-# Name "json - Win32 Release_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=".\json.c"
-# End Source File
-# Begin Source File
-
-SOURCE=.\JSON_parser.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\JSON_parser.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\utf8_decode.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\utf8_decode.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\utf8_to_utf16.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\utf8_to_utf16.h
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_json.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index f00799e946..f74de699ee 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -388,6 +388,23 @@ static int _get_lderrno(LDAP *ldap) } /* }}} */ +/* {{{ _set_lderrno + */ +static void _set_lderrno(LDAP *ldap, int lderr) +{ +#if !HAVE_NSLDAP +#if LDAP_API_VERSION > 2000 || HAVE_ORALDAP + /* New versions of OpenLDAP do it this way */ + ldap_set_option(ldap, LDAP_OPT_ERROR_NUMBER, &lderr); +#else + ldap->ld_errno = lderr; +#endif +#else + ldap_set_lderrno(ldap, lderr, NULL, NULL); +#endif +} +/* }}} */ + /* {{{ proto bool ldap_bind(resource link [, string dn [, string password]]) Bind to LDAP directory */ PHP_FUNCTION(ldap_bind) @@ -402,18 +419,20 @@ PHP_FUNCTION(ldap_bind) RETURN_FALSE; } + ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); + 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"); 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"); RETURN_FALSE; } - ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, "ldap link", le_link); - 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)); RETURN_FALSE; diff --git a/ext/ldap/ldap.dsp b/ext/ldap/ldap.dsp deleted file mode 100644 index 4d37cf3173..0000000000 --- a/ext/ldap/ldap.dsp +++ /dev/null @@ -1,288 +0,0 @@ -# Microsoft Developer Studio Project File - Name="ldap" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=ldap - Win32 Debug_TS_SSL
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "ldap.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "ldap.mak" CFG="ldap - Win32 Debug_TS_SSL"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "ldap - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "ldap - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "ldap - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "ldap - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "ldap - Win32 Release_TS SASL" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "ldap - Win32 Debug_TS SASL" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "ldap - Win32 Release_TS_SSL" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "ldap - Win32 Debug_TS_SSL" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "ldap - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "NDEBUG" /D ZEND_DEBUG=0 /D "COMPILE_DL_LDAP_LDAP" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 oldap32.lib olber32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib php7nts.lib /nologo /dll /machine:I386 /out:"Release/php_ldap.dll" /libpath:"..\..\Release" /libpath:"..\..\..\php_build\openldap\libraries\Release"
-
-!ELSEIF "$(CFG)" == "ldap - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "COMPILE_DL_LDAP_LDAP" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 oldap32.lib olber32.lib php7nts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /debug /machine:I386 /out:"Debug/php_ldap.dll" /pdbtype:sept /libpath:"..\..\Debug" /libpath:"..\..\..\php_build\openldap\libraries\Debug"
-
-!ELSEIF "$(CFG)" == "ldap - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\openldap\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /D ZEND_DEBUG=1 /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 oldap32.lib olber32.lib php7nts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\openldap\libraries\Debug" /libpath:"..\..\Debug"
-# ADD LINK32 oldap32.lib olber32.lib php7ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_ldap.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\openldap\libraries\Debug"
-
-!ELSEIF "$(CFG)" == "ldap - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\openldap\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /D ZEND_DEBUG=0 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 oldap32.lib olber32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib php7ts.lib /nologo /dll /machine:I386
-# ADD LINK32 oldap32.lib olber32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib php7ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ldap.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\openldap\libraries\Release" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "ldap - Win32 Release_TS SASL"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "ldap___Win32_Release_TS_SASL"
-# PROP BASE Intermediate_Dir "ldap___Win32_Release_TS_SASL"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS_SASL"
-# PROP Intermediate_Dir "Release_TS_SASL"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 oldap32.lib olber32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib php7ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ldap.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\openldap\libraries\Release" /libpath:"..\..\Release_TS_Inline"
-# ADD LINK32 oldap32.lib olber32.lib libsasl.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib php7ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ldap.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\openldap\libraries\Release" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "ldap - Win32 Debug_TS SASL"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "ldap___Win32_Debug_TS_SASL"
-# PROP BASE Intermediate_Dir "ldap___Win32_Debug_TS_SASL"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS_SASL"
-# PROP Intermediate_Dir "Debug_TS_SASL"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 oldap32.lib olber32.lib php7ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /debug /machine:I386 /out:"Debug_TS/php_ldap.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\openldap\libraries\Debug"
-# ADD LINK32 oldap32.lib olber32.lib libsasl.lib php7ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_ldap.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\openldap\libraries\Debug"
-
-!ELSEIF "$(CFG)" == "ldap - Win32 Release_TS_SSL"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "ldap___Win32_Release_TS_SSL"
-# PROP BASE Intermediate_Dir "ldap___Win32_Release_TS_SSL"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS_SSL"
-# PROP Intermediate_Dir "Release_TS_SSL"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 oldap32.lib olber32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib php7ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ldap.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\openldap\libraries\Release" /libpath:"..\..\Release_TS_Inline"
-# ADD LINK32 php7ts.lib oldap32.lib olber32.lib ssleay32.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_ldap.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\openldap\libraries\Release" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "ldap - Win32 Debug_TS_SSL"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "ldap___Win32_Debug_TS_SSL"
-# PROP BASE Intermediate_Dir "ldap___Win32_Debug_TS_SSL"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS_SSL"
-# PROP Intermediate_Dir "Debug_TS_SSL"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\openldap\include" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "COMPILE_DL_LDAP" /D "HAVE_LDAP_START_TLS_S" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LDAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LDAP=1 /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 oldap32.lib olber32.lib php7ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_ldap.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\openldap\libraries\Debug"
-# ADD LINK32 php7ts_debug.lib oldap32.lib olber32.lib ssleay32.lib libeay32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_ldap.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\openldap\libraries\Debug"
-
-!ENDIF
-
-# Begin Target
-
-# Name "ldap - Win32 Release"
-# Name "ldap - Win32 Debug"
-# Name "ldap - Win32 Debug_TS"
-# Name "ldap - Win32 Release_TS"
-# Name "ldap - Win32 Release_TS SASL"
-# Name "ldap - Win32 Debug_TS SASL"
-# Name "ldap - Win32 Release_TS_SSL"
-# Name "ldap - Win32 Debug_TS_SSL"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\ldap.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_ldap.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# Begin Source File
-
-SOURCE=.\LDAP_Win32_HOWTO.txt
-# End Source File
-# End Target
-# End Project
diff --git a/ext/mbstring/mbstring.dsp b/ext/mbstring/mbstring.dsp deleted file mode 100644 index c806ff0b78..0000000000 --- a/ext/mbstring/mbstring.dsp +++ /dev/null @@ -1,1112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="mbstring" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=mbstring - Win32 Debug_TS MBSTRING
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "mbstring.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "mbstring.mak" CFG="mbstring - Win32 Debug_TS MBSTRING"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "mbstring - Win32 Release_TS MBSTRING" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "mbstring - Win32 Debug_TS MBSTRING" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "mbstring___Win32_Release_TS_MBSTRING"
-# PROP BASE Intermediate_Dir "mbstring___Win32_Release_TS_MBSTRING"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "_MBCS" /D "_USRDLL" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MBSTRING" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D MBSTRING_EXPORTS=1 /D HAVE_MBSTRING=1 /D HAVE_MBREGEX=1 /D HAVE_MBSTR_CN=1 /D HAVE_MBSTR_JA=1 /D HAVE_MBSTR_KR=1 /D HAVE_MBSTR_RU=1 /D HAVE_MBSTR_TW=1 /FR /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "libmbfl" /I "libmbfl\mbfl" /D ZEND_DEBUG=0 /D "MBSTRING_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MBSTRING" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MBSTRING=1 /D HAVE_MBSTR_CN=1 /D HAVE_MBSTR_JA=1 /D HAVE_MBSTR_KR=1 /D HAVE_MBSTR_RU=1 /D HAVE_MBSTR_TW=1 /D MBFL_DLL_EXPORT=1 /D NOT_RUBY=1 /D "LIBMBFL_EXPORTS" /D "HAVE_STRICMP" /D "HAVE_CONFIG_H" /D "HAVE_STDLIB_H" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php7ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mbstring.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-# ADD LINK32 php7ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mbstring.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "mbstring___Win32_Debug_TS_MBSTRING"
-# PROP BASE Intermediate_Dir "mbstring___Win32_Debug_TS_MBSTRING"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "MBSTRING_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MBSTRING" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D MBSTRING_EXPORTS=1 /D HAVE_MBSTRING=1 /D HAVE_MBREGEX=1 /D HAVE_MBSTR_CN=1 /D HAVE_MBSTR_JA=1 /D HAVE_MBSTR_KR=1 /D HAVE_MBSTR_RU=1 /D HAVE_MBSTR_TW=1 /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "libmbfl" /I "libmbfl\mbfl" /I "oniguruma" /D ZEND_DEBUG=1 /D MBSTRING_EXPORTS=1 /D HAVE_STDLIB_H=1 /D HAVE_STRING_H=1 /D "MBSTRING_EXPORTS" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MBSTRING" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MBSTRING=1 /D HAVE_MBSTR_CN=1 /D HAVE_MBSTR_JA=1 /D HAVE_MBSTR_KR=1 /D HAVE_MBSTR_RU=1 /D HAVE_MBSTR_TW=1 /D MBFL_DLL_EXPORT=1 /D NOT_RUBY=1 /D "LIBMBFL_EXPORTS" /D "HAVE_STRICMP" /D "HAVE_CONFIG_H" /D "HAVE_STDLIB_H" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php7ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_mbstring.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-# ADD LINK32 php7ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_mbstring.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "mbstring - Win32 Release_TS MBSTRING"
-# Name "mbstring - Win32 Debug_TS MBSTRING"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\mb_gpc.c
-
-!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING"
-
-# PROP Intermediate_Dir "Release_TS"
-
-!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING"
-
-# PROP Intermediate_Dir "Debug_TS"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\mbstring.c
-
-!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING"
-
-# PROP Intermediate_Dir "Release_TS"
-
-!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING"
-
-# PROP Intermediate_Dir "Debug_TS"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_mbregex.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_unicode.c
-
-!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING"
-
-# PROP Intermediate_Dir "Release_TS"
-
-!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING"
-
-# PROP Intermediate_Dir "Debug_TS"
-
-!ENDIF
-
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\mb_gpc.h
-
-!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING"
-
-# PROP Intermediate_Dir "Release_TS"
-
-!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING"
-
-# PROP Intermediate_Dir "Debug_TS"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\mbstring.h
-
-!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING"
-
-# PROP Intermediate_Dir "Release_TS"
-
-!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING"
-
-# PROP Intermediate_Dir "Debug_TS"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_mbregex.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_unicode.h
-
-!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING"
-
-# PROP Intermediate_Dir "Release_TS"
-
-!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING"
-
-# PROP Intermediate_Dir "Debug_TS"
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\unicode_data.h
-
-!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING"
-
-# PROP Intermediate_Dir "Release_TS"
-
-!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING"
-
-# PROP Intermediate_Dir "Debug_TS"
-
-!ENDIF
-
-# End Source File
-# End Group
-# Begin Group "libmbfl"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 1"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\html_entities.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfilter.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_7bit.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfilter_8bit.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_ascii.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_base64.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_big5.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_byte2.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_byte4.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp1251.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp1252.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp866.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp932.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp936.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_euc_cn.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_euc_jp.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_euc_jp_win.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_euc_kr.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_euc_tw.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_htmlent.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_hz.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso2022_kr.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_1.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_10.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_13.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_14.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_15.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_2.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_3.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_4.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_5.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_6.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_7.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_8.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_9.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_jis.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_koi8r.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_koi8u.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_armscii8.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp850.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfilter_pass.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_qprint.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_sjis.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_ucs2.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_ucs4.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_uhc.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_utf16.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_utf32.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_utf7.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_utf7imap.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_utf8.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_uuencode.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfilter_wchar.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_allocators.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_convert.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_encoding.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_filter_output.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_ident.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_language.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_memory_device.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_string.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_de.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_en.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_ja.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_kr.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_neutral.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_ru.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_uni.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_zh.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_hy.c
-# End Source File
-# End Group
-# Begin Group "Header Files No. 1"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\libmbfl\config.h.vc6
-
-!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING"
-
-# Begin Custom Build
-InputDir=.\libmbfl
-InputPath=.\libmbfl\config.h.vc6
-
-"$(InputDir)\config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- copy $(InputDir)\config.h.vc6 "$(InputDir)\config.h"
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING"
-
-# Begin Custom Build
-InputDir=.\libmbfl
-InputPath=.\libmbfl\config.h.vc6
-
-"$(InputDir)\config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- copy $(InputDir)\config.h.vc6 "$(InputDir)\config.h"
-
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\cp932_table.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\html_entities.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfilter.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_7bit.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfilter_8bit.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_ascii.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_base64.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_big5.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_byte2.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_byte4.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp1251.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp1252.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp866.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp932.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp936.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_euc_cn.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_euc_jp.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_euc_jp_win.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_euc_kr.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_euc_tw.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_htmlent.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_hz.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso2022_kr.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_1.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_10.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_13.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_14.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_15.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_2.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_3.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_4.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_5.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_6.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_7.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_8.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_iso8859_9.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_jis.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_koi8r.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_koi8u.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_armscii8.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_cp850.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfilter_pass.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_qprint.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_sjis.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_ucs2.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_ucs4.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_uhc.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_utf16.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_utf32.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_utf7.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_utf7imap.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_utf8.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\mbfilter_uuencode.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfilter_wchar.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_allocators.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_consts.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_convert.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_defs.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_encoding.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_filter_output.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_ident.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_language.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_memory_device.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\mbfl\mbfl_string.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_de.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_en.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_ja.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_kr.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_neutral.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_ru.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_uni.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_zh.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\nls\nls_hy.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_prop.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_big5.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_cns11643.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_cp1251.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_cp1252.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_cp866.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_cp932_ext.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_cp936.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_10.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_13.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_14.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_15.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_2.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_3.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_4.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_5.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_6.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_7.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_8.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_iso8859_9.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_jis.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_koi8r.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_koi8u.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_armscii8.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_cp850.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libmbfl\filters\unicode_table_uhc.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "oniguruma"
-
-# PROP Default_Filter ""
-# Begin Group "Source Files No. 2"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\oniguruma\regcomp.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\regerror.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\regexec.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\reggnu.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\regparse.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\regposerr.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\ascii.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\utf8.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\euc_jp.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\euc_tw.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\euc_kr.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\sjis.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_1.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_2.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_3.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_4.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_5.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_6.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_7.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_8.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_9.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_10.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_11.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_13.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_14.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_15.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\iso8859_16.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\koi8.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\koi8_r.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\enc\big5.c
-# End Source File
-# End Group
-# Begin Group "Header Files No. 2"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\oniguruma\win32\config.h
-
-!IF "$(CFG)" == "mbstring - Win32 Release_TS MBSTRING"
-
-# Begin Custom Build
-InputDir=.\oniguruma\win32
-InputPath=.\oniguruma\win32\config.h
-
-"$(InputDir)\..\config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- copy $(InputDir)\config.h "$(InputDir)\..\config.h"
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "mbstring - Win32 Debug_TS MBSTRING"
-
-# Begin Custom Build
-InputDir=.\oniguruma\win32
-InputPath=.\oniguruma\win32\config.h
-
-"$(InputDir)\..\config.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- copy $(InputDir)\config.h "$(InputDir)\..\config.h"
-
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\onigposix.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\oniguruma.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\php_compat.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\regint.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\oniguruma\regparse.h
-# End Source File
-# End Group
-# End Group
-# End Target
-# End Project
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index de0bc768ad..8be88c3fee 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -1343,8 +1343,7 @@ PHP_FUNCTION(mb_ereg_search_init) zval_ptr_dtor(&MBREX(search_str)); } - ZVAL_COPY(&MBREX(search_str), arg_str); - SEPARATE_ZVAL_IF_NOT_REF(&MBREX(search_str)); + ZVAL_DUP(&MBREX(search_str), arg_str); MBREX(search_pos) = 0; diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index 82cbe72176..4341bbe5c1 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -573,7 +573,7 @@ PHP_FUNCTION(mcrypt_generic_init) php_error_docref(NULL TSRMLS_CC, E_WARNING, "Key size too large; supplied length: %d, max: %d", key_len, max_key_size); key_size = max_key_size; } else { - key_size = key_len; + key_size = (int)key_len; } memcpy(key_s, key, key_len); @@ -636,12 +636,12 @@ PHP_FUNCTION(mcrypt_generic) /* Check blocksize */ if (mcrypt_enc_is_block_mode(pm->td) == 1) { /* It's a block algorithm */ block_size = mcrypt_enc_get_block_size(pm->td); - data_size = (((data_len - 1) / block_size) + 1) * block_size; + data_size = ((((int)data_len - 1) / block_size) + 1) * block_size; data_s = emalloc(data_size + 1); memset(data_s, 0, data_size); memcpy(data_s, data, data_len); } else { /* It's not a block algorithm */ - data_size = data_len; + data_size = (int)data_len; data_s = emalloc(data_size + 1); memset(data_s, 0, data_size); memcpy(data_s, data, data_len); @@ -681,12 +681,12 @@ PHP_FUNCTION(mdecrypt_generic) /* Check blocksize */ if (mcrypt_enc_is_block_mode(pm->td) == 1) { /* It's a block algorithm */ block_size = mcrypt_enc_get_block_size(pm->td); - data_size = (((data_len - 1) / block_size) + 1) * block_size; + data_size = ((((int)data_len - 1) / block_size) + 1) * block_size; data_s = emalloc(data_size + 1); memset(data_s, 0, data_size); memcpy(data_s, data, data_len); } else { /* It's not a block algorithm */ - data_size = data_len; + data_size = (int)data_len; data_s = emalloc(data_size + 1); memset(data_s, 0, data_size); memcpy(data_s, data, data_len); @@ -1238,7 +1238,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, int key_len, const char *data, int 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 TSRMLS_DC) /* {{{ */ { char *cipher_dir_string; char *module_dir_string; @@ -1254,12 +1254,12 @@ static void php_mcrypt_do_crypt(char* cipher, const char *key, int key_len, cons RETURN_FALSE; } - if (php_mcrypt_ensure_valid_key_size(td, key_len TSRMLS_CC) == FAILURE) { + if (php_mcrypt_ensure_valid_key_size(td, (int)key_len TSRMLS_CC) == FAILURE) { mcrypt_module_close(td); RETURN_FALSE; } - if (php_mcrypt_ensure_valid_iv(td, iv, iv_len TSRMLS_CC) == FAILURE) { + if (php_mcrypt_ensure_valid_iv(td, iv, (int)iv_len TSRMLS_CC) == FAILURE) { mcrypt_module_close(td); RETURN_FALSE; } @@ -1267,7 +1267,7 @@ static void php_mcrypt_do_crypt(char* cipher, const char *key, int key_len, cons /* Check blocksize */ if (mcrypt_enc_is_block_mode(td) == 1) { /* It's a block algorithm */ int block_size = mcrypt_enc_get_block_size(td); - data_size = (((data_len - 1) / block_size) + 1) * block_size; + data_size = ((((zend_long)data_len - 1) / block_size) + 1) * block_size; data_s = emalloc(data_size + 1); memset(data_s, 0, data_size); memcpy(data_s, data, data_len); @@ -1277,16 +1277,16 @@ static void php_mcrypt_do_crypt(char* cipher, const char *key, int key_len, cons memcpy(data_s, data, data_len); } - if (mcrypt_generic_init(td, (void *) key, key_len, (void *) iv) < 0) { + 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"); mcrypt_module_close(td); RETURN_FALSE; } if (dencrypt == MCRYPT_ENCRYPT) { - mcrypt_generic(td, data_s, data_size); + mcrypt_generic(td, data_s, (int)data_size); } else { - mdecrypt_generic(td, data_s, data_size); + mdecrypt_generic(td, data_s, (int)data_size); } data_s[data_size] = 0; @@ -1424,7 +1424,7 @@ PHP_FUNCTION(mcrypt_create_iv) php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not gather sufficient random data"); RETURN_FALSE; } - n = size; + n = (int)size; #else int fd; size_t read_bytes = 0; @@ -1451,7 +1451,7 @@ PHP_FUNCTION(mcrypt_create_iv) } #endif } else { - n = size; + n = (int)size; while (size) { iv[--size] = (char) (255.0 * php_rand(TSRMLS_C) / RAND_MAX); } diff --git a/ext/mcrypt/mcrypt.dsp b/ext/mcrypt/mcrypt.dsp deleted file mode 100644 index b335bf7d9e..0000000000 --- a/ext/mcrypt/mcrypt.dsp +++ /dev/null @@ -1,117 +0,0 @@ -# Microsoft Developer Studio Project File - Name="mcrypt" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=mcrypt - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "mcrypt.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "mcrypt.mak" CFG="mcrypt - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "mcrypt - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "mcrypt - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "mcrypt - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_MCRYPT" /D "DBNTWIN32" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\mcrypt\include" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MCRYPT_EXPORTS" /D "COMPILE_DL_MCRYPT" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LIBMCRYPT=1 /D HAVE_LIBMCRYPT24=1 /D HAVE_MCRYPT_GENERIC_DEINIT /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib ntwdblib.lib /nologo /dll /machine:I386 /out:"MSSQL_65_Release/php_mssql.dll" /libpath:"..\..\Release_TS"
-# ADD LINK32 php7ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmcrypt.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mcrypt.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\mcrypt" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\TSRM\Release_TS" /libpath:"..\..\TSRM\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "mcrypt - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "mssql-70" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_MCRYPT" /D "DBNTWIN32" /D ZTS=1 /D MSSQL70=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\mcrypt\include" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MCRYPT_EXPORTS" /D "COMPILE_DL_MCRYPT" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LIBMCRYPT=1 /D HAVE_LIBMCRYPT24=1 /D HAVE_MCRYPT_GENERIC_DEINIT /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib ntwdblib.lib /nologo /dll /machine:I386 /out:"MSSQL_65_Release/php_mssql.dll" /libpath:"..\..\Release_TS" /libpath:"mssql-70"
-# ADD LINK32 php7ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmcrypt.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_mcrypt.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\mcrypt\lib"
-
-!ENDIF
-
-# Begin Target
-
-# Name "mcrypt - Win32 Release_TS"
-# Name "mcrypt - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\mcrypt.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\win32\readdir.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_mcrypt.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\win32\readdir.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/mcrypt/mcrypt_filter.c b/ext/mcrypt/mcrypt_filter.c index 26f3dceba7..c36e9494e3 100644 --- a/ext/mcrypt/mcrypt_filter.c +++ b/ext/mcrypt/mcrypt_filter.c @@ -60,7 +60,7 @@ static php_stream_filter_status_t php_mcrypt_filter( if (data->blocksize) { /* Blockmode cipher */ char *outchunk; - int chunklen = bucket->buflen + data->block_used, n; + int chunklen = (int)(bucket->buflen + data->block_used), n; php_stream_bucket *newbucket; outchunk = pemalloc(chunklen, data->persistent); @@ -91,9 +91,9 @@ static php_stream_filter_status_t php_mcrypt_filter( /* Stream cipher */ php_stream_bucket_make_writeable(bucket TSRMLS_CC); if (data->encrypt) { - mcrypt_generic(data->module, bucket->buf, bucket->buflen); + mcrypt_generic(data->module, bucket->buf, (int)bucket->buflen); } else { - mdecrypt_generic(data->module, bucket->buf, bucket->buflen); + mdecrypt_generic(data->module, bucket->buf, (int)bucket->buflen); } php_stream_bucket_append(buckets_out, bucket TSRMLS_CC); @@ -201,13 +201,13 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval if ((tmpzval = zend_hash_str_find(HASH_OF(filterparams), ZEND_STRL("key"))) && Z_TYPE_P(tmpzval) == IS_STRING) { key = Z_STRVAL_P(tmpzval); - key_len = Z_STRLEN_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"); return NULL; } - mcrypt_module = mcrypt_module_open(cipher, algo_dir, mode, mode_dir); + 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"); return NULL; diff --git a/ext/mssql/mssql.dsp b/ext/mssql/mssql.dsp deleted file mode 100644 index 58b9ec507e..0000000000 --- a/ext/mssql/mssql.dsp +++ /dev/null @@ -1,117 +0,0 @@ -# Microsoft Developer Studio Project File - Name="mssql" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=mssql - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "mssql.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "mssql.mak" CFG="mssql - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "mssql - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "mssql - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "mssql - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D MSSQL70=1 /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_MSSQL" /D "DBNTWIN32" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MSSQL=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D MSSQL70=1 /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_MSSQL" /D "DBNTWIN32" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MSSQL=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib ntwdblib.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mssql70.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\mssql-70\lib" /libpath:"..\..\Release_TS_Inline"
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib ntwdblib.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mssql.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\mssql-70\lib" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "mssql - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D MSSQL70=1 /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_MSSQL" /D "DBNTWIN32" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MSSQL=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D MSSQL70=1 /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MSSQL_EXPORTS" /D "COMPILE_DL_MSSQL" /D "DBNTWIN32" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MSSQL=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts_debug.lib ntwdblib.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_mssql70.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\mssql-70\lib"
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts_debug.lib ntwdblib.lib /nologo /dll /incremental:yes /debug /machine:I386 /out:"..\..\Debug_TS/php_mssql.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\mssql-70\lib"
-
-!ENDIF
-
-# Begin Target
-
-# Name "mssql - Win32 Release_TS"
-# Name "mssql - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\php_mssql.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_mssql.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# Begin Source File
-
-SOURCE=.\mssql_win32_howto.txt
-# End Source File
-# End Target
-# End Project
diff --git a/ext/mysql/mysql.dsp b/ext/mysql/mysql.dsp deleted file mode 100644 index 31b015fdaa..0000000000 --- a/ext/mysql/mysql.dsp +++ /dev/null @@ -1,171 +0,0 @@ -# Microsoft Developer Studio Project File - Name="mysql" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=mysql - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "mysql.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "mysql.mak" CFG="mysql - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "mysql - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "mysql - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "mysql - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "mysql - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "mysql - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQL_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\MySQL\include" /I "..\..\TSRM" /D "NDEBUG" /D "MYSQL_EXPORTS" /D "COMPILE_DL_MYSQL" /D HAVE_MYSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_MYSQL" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "NDEBUG"
-# ADD RSC /l 0x40d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmySQL.lib php7nts.lib /nologo /dll /machine:I386 /out:"Release/php_mysql.dll" /libpath:"..\..\..\MySQL\lib\opt" /libpath:"..\..\Release"
-
-!ELSEIF "$(CFG)" == "mysql - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQL_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\MySQL\include" /I "..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "MYSQL_EXPORTS" /D "COMPILE_DL_MYSQL" /D HAVE_MYSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_MYSQL" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "_DEBUG"
-# ADD RSC /l 0x40d /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmySQL.lib php7nts_debug.lib /nologo /dll /debug /machine:I386 /out:"Debug/php_mysql.dll" /pdbtype:sept /libpath:"..\..\..\MySQL\lib\Debug" /libpath:"..\..\Debug"
-
-!ELSEIF "$(CFG)" == "mysql - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQL_EXPORTS" /D "COMPILE_DL_MYSQL" /D HAVE_MYSQL=1 /FR /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\MySQL\include" /I "..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "ZTS" /D "MYSQL_EXPORTS" /D "COMPILE_DL_MYSQL" /D HAVE_MYSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_MYSQL" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "_DEBUG"
-# ADD RSC /l 0x40d /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php7ts_debug.lib libmySQL.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_mysql.dll" /pdbtype:sept /libpath:"..\..\..\MySQL\lib\Debug" /libpath:"..\..\Debug_TS"
-
-!ELSEIF "$(CFG)" == "mysql - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQL_EXPORTS" /D "COMPILE_DL_MYSQL" /D HAVE_MYSQL=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\MySQL\include" /I "..\..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "ZTS" /D "MYSQL_EXPORTS" /D "COMPILE_DL_MYSQL" /D HAVE_MYSQL=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_MYSQL" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x40d /d "NDEBUG"
-# ADD RSC /l 0x40d /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmySQL.lib php7ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mysql.dll" /libpath:"..\..\..\MySQL\lib\opt" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ENDIF
-
-# Begin Target
-
-# Name "mysql - Win32 Release"
-# Name "mysql - Win32 Debug"
-# Name "mysql - Win32 Debug_TS"
-# Name "mysql - Win32 Release_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\php_mysql.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_mysql.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# Begin Source File
-
-SOURCE=.\Readme_w32.txt
-# End Source File
-# End Target
-# End Project
diff --git a/ext/mysqli/mysqli.dsp b/ext/mysqli/mysqli.dsp deleted file mode 100755 index 96624e60fc..0000000000 --- a/ext/mysqli/mysqli.dsp +++ /dev/null @@ -1,120 +0,0 @@ -# Microsoft Developer Studio Project File - Name="mysqli" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=mysqli - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "mysqli.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "mysqli.mak" CFG="mysqli - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "mysqli - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "mysqli - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "mysqli - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQLI_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\include" /I "..\..\..\php_build\include\mysqli" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MYSQLI" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "PHP_MYSQLI_EXPORTS" /D "HAVE_ZLIB" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php7ts.lib zlib.lib libmySQL.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_mysqli.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\release"
-
-!ELSEIF "$(CFG)" == "mysqli - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQLI_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\include" /I "..\..\..\php_build\include\mysqli" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_MYSQLI" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "PHP_MYSQLI_EXPORTS" /D "HAVE_ZLIB" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php7ts_debug.lib zlib.lib libmySQL.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_mysqli.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\release"
-
-!ENDIF
-
-# Begin Target
-
-# Name "mysqli - Win32 Release_TS"
-# Name "mysqli - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\mysqli.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\mysqli_api.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\mysqli_fe.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\mysqli_nonapi.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_mysqli.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 4eff098999..69799729b7 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -791,7 +791,7 @@ PHP_FUNCTION(mysqli_data_seek) RETURN_FALSE; } - if (offset < 0 || offset >= mysql_num_rows(result)) { + if (offset < 0 || (uint64_t)offset >= mysql_num_rows(result)) { RETURN_FALSE; } diff --git a/ext/mysqli/tests/bug33491.phpt b/ext/mysqli/tests/bug33491.phpt index 7e994bc4d0..c83e126495 100644 --- a/ext/mysqli/tests/bug33491.phpt +++ b/ext/mysqli/tests/bug33491.phpt @@ -1,7 +1,7 @@ --TEST-- Bug #33491 (extended mysqli class crashes when result is not object) --INI-- -error_reporting=4095 +error_reporting=4096 --SKIPIF-- <?php require_once('skipif.inc'); @@ -26,4 +26,4 @@ $DB->query_single('SELECT DATE()'); ?> --EXPECTF-- -Fatal error: Call to a member function fetch_row() on boolean in %sbug33491.php on line %d +Catchable fatal error: Call to a member function fetch_row() on boolean in %sbug33491.php on line %d diff --git a/ext/mysqli/tests/mysqli_change_user_new.phpt b/ext/mysqli/tests/mysqli_change_user_new.phpt index e16895766f..06c721ac87 100644 --- a/ext/mysqli/tests/mysqli_change_user_new.phpt +++ b/ext/mysqli/tests/mysqli_change_user_new.phpt @@ -41,4 +41,4 @@ Warning: mysqli_query(): MySQL server has gone away in %s on line %d Warning: mysqli_query(): Error reading result set's header in %s on line %d [003] [2006] MySQL server has gone away -Fatal error: Call to a member function fetch_assoc() on %s in %s on line %d
\ No newline at end of file +Catchable fatal error: Call to a member function fetch_assoc() on %s in %s on line %d diff --git a/ext/mysqlnd/config.w32 b/ext/mysqlnd/config.w32 index c803042ee1..b13a81530a 100644 --- a/ext/mysqlnd/config.w32 +++ b/ext/mysqlnd/config.w32 @@ -26,8 +26,11 @@ if (PHP_MYSQLND != "no") { "mysqlnd_wireprotocol.c " + "php_mysqlnd.c "; EXTENSION("mysqlnd", mysqlnd_source, false); - 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))) + 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))) && + CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS", "..\\zlib;" + php_usual_include_suspects) + ) { AC_DEFINE("MYSQLND_COMPRESSION_ENABLED", 1, "Compression support"); AC_DEFINE("MYSQLND_SSL_SUPPORTED", 1, "SSL support"); diff --git a/ext/mysqlnd/config9.m4 b/ext/mysqlnd/config9.m4 index 816f4431f5..1a0136d8db 100644 --- a/ext/mysqlnd/config9.m4 +++ b/ext/mysqlnd/config9.m4 @@ -58,12 +58,17 @@ dnl AC_CACHE_CHECK([whether whether compiler supports Decimal32/64/128 types], ac_cv_decimal_fp_supported,[ AC_TRY_RUN( [ #include <stdio.h> +#include <string.h> int main(int argc, char **argv) { typedef float dec32 __attribute__((mode(SD))); dec32 k = 99.49f; double d2 = (double)k; - return 0; + const char *check_str = "99.49"; + char print_str[32]; + + snprintf(print_str, 32, "%f", d2); + return memcmp(print_str, check_str, 5); } ],[ ac_cv_decimal_fp_supported=yes diff --git a/ext/oci8/oci8.dsp b/ext/oci8/oci8.dsp deleted file mode 100644 index c889d0cd60..0000000000 --- a/ext/oci8/oci8.dsp +++ /dev/null @@ -1,133 +0,0 @@ -# Microsoft Developer Studio Project File - Name="oci8" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=oci8 - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "oci8.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "oci8.mak" CFG="oci8 - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "oci8 - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "oci8 - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "oci8 - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\\" /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\include\instantclient" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_OCI8=1 /D HAVE_OCI8_TEMP_LOB=1 /D HAVE_OCI8_ATTR_STATEMENT=1 /D COMPILE_DL_OCI8=1 /D PHP_OCI8_HAVE_COLLECTIONS=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib /nologo /dll /machine:I386
-# ADD LINK32 php4ts.lib oci.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_oci8.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\lib\instantclient" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "oci8 - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\..\\" /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\include\instantclient" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FTP_EXPORTS" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_OCI8=1 /D HAVE_OCI8_TEMP_LOB=1 /D HAVE_OCI8_ATTR_STATEMENT=1 /D COMPILE_DL_OCI8=1 /D PHP_OCI8_HAVE_COLLECTIONS=1 /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib /nologo /dll /machine:I386
-# ADD LINK32 php4ts_debug.lib oci.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_oci8.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\lib\instantclient"
-
-!ENDIF
-
-# Begin Target
-
-# Name "oci8 - Win32 Release_TS"
-# Name "oci8 - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\oci8.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oci8_collection.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oci8_interface.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oci8_lob.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\oci8_statement.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_oci8.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_oci8_int.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 13bd9e1628..6729163996 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -945,14 +945,15 @@ int odbc_bindcols(odbc_result *result TSRMLS_DC) SQLUSMALLINT colfieldid; int charextraalloc; - colfieldid = SQL_COLUMN_DISPLAY_SIZE; - charextraalloc = 0; result->values = (odbc_result_value *) safe_emalloc(sizeof(odbc_result_value), result->numcols, 0); result->longreadlen = ODBCG(defaultlrl); result->binmode = ODBCG(defaultbinmode); for(i = 0; i < result->numcols; i++) { + charextraalloc = 0; + colfieldid = SQL_COLUMN_DISPLAY_SIZE; + rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_NAME, result->values[i].name, sizeof(result->values[i].name), &colnamelen, 0); rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_TYPE, diff --git a/ext/odbc/tests/bug68087.phpt b/ext/odbc/tests/bug68087.phpt new file mode 100644 index 0000000000..3bc18125a6 --- /dev/null +++ b/ext/odbc/tests/bug68087.phpt @@ -0,0 +1,57 @@ +--TEST-- +odbc_exec(): Getting accurate date data from query +--SKIPIF-- +<?php include 'skipif.inc'; ?> +--FILE-- +<?php + +include 'config.inc'; + +$id_1_date = '2014-09-23'; +$id_2_date = '2014-09-24'; + +$conn = odbc_connect($dsn, $user, $pass); + +@odbc_exec($conn, 'CREATE DATABASE odbcTEST'); + +odbc_exec($conn, 'CREATE TABLE FOO (ID INT, VARCHAR_COL VARCHAR(100), DATE_COL DATE)'); + +odbc_exec($conn, "INSERT INTO FOO(ID, VARCHAR_COL, DATE_COL) VALUES (1, 'hello', '$id_1_date')"); +odbc_exec($conn, "INSERT INTO FOO(ID, VARCHAR_COL, DATE_COL) VALUES (2, 'helloagain', '$id_2_date')"); + +$res = odbc_exec($conn, 'SELECT * FROM FOO ORDER BY ID ASC'); + +while(odbc_fetch_row($res)) { + $id = odbc_result($res, "ID"); + $varchar_col = odbc_result($res, "VARCHAR_COL"); + $date = odbc_result($res, "DATE_COL"); + + if ($id == 1) { + if ($date != $id_1_date) { + print "Date_1 mismatched\n"; + } else { + print "Date_1 matched\n"; + } + } else { + if ($date != $id_2_date) { + print "Date_2 mismatched\n"; + } else { + print "Date_2 matched\n"; + } + } +} + +?> +--EXPECT-- +Date_1 matched +Date_2 matched +--CLEAN-- +<?php +include 'config.inc'; + +$conn = odbc_connect($dsn, $user, $pass); + +odbc_exec($conn, 'DROP TABLE FOO'); +odbc_exec($conn, 'DROP DATABASE odbcTEST'); + +?> diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c index 1f873912b4..5c6880beea 100644 --- a/ext/opcache/Optimizer/block_pass.c +++ b/ext/opcache/Optimizer/block_pass.c @@ -169,6 +169,7 @@ static int find_code_blocks(zend_op_array *op_array, zend_cfg *cfg, zend_optimiz case ZEND_FE_RESET: case ZEND_NEW: case ZEND_JMP_SET: + case ZEND_COALESCE: START_BLOCK_OP(ZEND_OP2(opline).opline_num); START_BLOCK_OP(opno + 1); break; @@ -203,14 +204,12 @@ static int find_code_blocks(zend_op_array *op_array, zend_cfg *cfg, zend_optimiz j = 0; for (i = 0; i< op_array->last_brk_cont; i++) { if (op_array->brk_cont_array[i].start >= 0 && - (op_array->opcodes[op_array->brk_cont_array[i].brk].opcode == ZEND_FREE || - op_array->opcodes[op_array->brk_cont_array[i].brk].opcode == ZEND_SWITCH_FREE)) { + op_array->opcodes[op_array->brk_cont_array[i].brk].opcode == ZEND_FREE) { int parent = op_array->brk_cont_array[i].parent; while (parent >= 0 && op_array->brk_cont_array[parent].start < 0 && - op_array->opcodes[op_array->brk_cont_array[parent].brk].opcode != ZEND_FREE && - op_array->opcodes[op_array->brk_cont_array[parent].brk].opcode != ZEND_SWITCH_FREE) { + op_array->opcodes[op_array->brk_cont_array[parent].brk].opcode != ZEND_FREE) { parent = op_array->brk_cont_array[parent].parent; } op_array->brk_cont_array[i].parent = parent; @@ -224,8 +223,7 @@ static int find_code_blocks(zend_op_array *op_array, zend_cfg *cfg, zend_optimiz j = 0; for (i = 0; i< op_array->last_brk_cont; i++) { if (op_array->brk_cont_array[i].start >= 0 && - (op_array->opcodes[op_array->brk_cont_array[i].brk].opcode == ZEND_FREE || - op_array->opcodes[op_array->brk_cont_array[i].brk].opcode == ZEND_SWITCH_FREE)) { + op_array->opcodes[op_array->brk_cont_array[i].brk].opcode == ZEND_FREE) { if (i != j) { op_array->brk_cont_array[j] = op_array->brk_cont_array[i]; } @@ -296,6 +294,7 @@ static int find_code_blocks(zend_op_array *op_array, zend_cfg *cfg, zend_optimiz case ZEND_FE_RESET: case ZEND_NEW: case ZEND_JMP_SET: + case ZEND_COALESCE: case ZEND_FE_FETCH: cur_block->op2_to = &blocks[ZEND_OP2(opline).opline_num]; /* break missing intentionally */ @@ -617,7 +616,7 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array, VAR_SOURCE(opline->op1)->opcode == ZEND_QM_ASSIGN && ZEND_OP1_TYPE(VAR_SOURCE(opline->op1)) == IS_CONST && opline->opcode != ZEND_CASE && /* CASE _always_ expects variable */ - opline->opcode != ZEND_FETCH_DIM_TMP_VAR && /* in 5.1, FETCH_DIM_TMP_VAR expects T */ + opline->opcode != ZEND_FETCH_LIST && opline->opcode != ZEND_FE_RESET && opline->opcode != ZEND_FREE ) { @@ -1056,25 +1055,6 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array, COPY_NODE(opline->op1, src->op1); MAKE_NOP(src); } else if ((opline->opcode == ZEND_ADD_STRING || - opline->opcode == ZEND_ADD_CHAR) && - ZEND_OP1_TYPE(opline) == IS_TMP_VAR && - VAR_SOURCE(opline->op1) && - VAR_SOURCE(opline->op1)->opcode == ZEND_INIT_STRING) { - /* convert T = INIT_STRING(), T = ADD_STRING(T, X) to T = QM_ASSIGN(X) */ - /* CHECKME: Remove ZEND_ADD_VAR optimization, since some conversions - - namely, BOOL(false)->string - don't allocate memory but use empty_string - and ADD_CHAR fails */ - zend_op *src = VAR_SOURCE(opline->op1); - VAR_UNSET(opline->op1); - COPY_NODE(opline->op1, opline->op2); - if (opline->opcode == ZEND_ADD_CHAR) { - char c = (char)Z_LVAL(ZEND_OP2_LITERAL(opline)); - ZVAL_STRINGL(&ZEND_OP1_LITERAL(opline), &c, 1); - } - SET_UNUSED(opline->op2); - MAKE_NOP(src); - opline->opcode = ZEND_QM_ASSIGN; - } else if ((opline->opcode == ZEND_ADD_STRING || opline->opcode == ZEND_ADD_CHAR || opline->opcode == ZEND_ADD_VAR || opline->opcode == ZEND_CONCAT) && @@ -1095,28 +1075,11 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array, opline->opcode = ZEND_CONCAT; literal_dtor(&ZEND_OP2_LITERAL(src)); /* will take care of empty_string too */ MAKE_NOP(src); -//??? This optimization can't work anymore because ADD_VAR returns IS_TMP_VAR -//??? and ZEND_CAST returns IS_VAR. -//??? BTW: it wan't used for long time, because we don't use INIT_STRING -#if 0 - } else if (opline->opcode == ZEND_ADD_VAR && - ZEND_OP1_TYPE(opline) == IS_TMP_VAR && - VAR_SOURCE(opline->op1) && - VAR_SOURCE(opline->op1)->opcode == ZEND_INIT_STRING) { - /* convert T = INIT_STRING(), T = ADD_VAR(T, X) to T = CAST(STRING, X) */ - zend_op *src = VAR_SOURCE(opline->op1); - VAR_UNSET(opline->op1); - COPY_NODE(opline->op1, opline->op2); - SET_UNUSED(opline->op2); - MAKE_NOP(src); - opline->opcode = ZEND_CAST; - opline->extended_value = IS_STRING; -#endif } else if ((opline->opcode == ZEND_ADD_STRING || opline->opcode == ZEND_ADD_CHAR || opline->opcode == ZEND_ADD_VAR || opline->opcode == ZEND_CONCAT) && - ZEND_OP1_TYPE(opline) == (IS_TMP_VAR|IS_VAR) && + (ZEND_OP1_TYPE(opline) & (IS_TMP_VAR|IS_VAR)) && VAR_SOURCE(opline->op1) && VAR_SOURCE(opline->op1)->opcode == ZEND_CAST && VAR_SOURCE(opline->op1)->extended_value == IS_STRING) { @@ -1363,10 +1326,9 @@ static void zend_jmp_optimization(zend_code_block *block, zend_op_array *op_arra } else if (0&& block->op1_to != block && block->op1_to != blocks && op_array->last_try_catch == 0 && - target->opcode != ZEND_FREE && - target->opcode != ZEND_SWITCH_FREE) { + target->opcode != ZEND_FREE) { /* Block Reordering (saves one JMP on each "for" loop iteration) - * It is disabled for some cases (ZEND_FREE/ZEND_SWITCH_FREE) + * It is disabled for some cases (ZEND_FREE) * which may break register allocation. */ zend_bool can_reorder = 0; diff --git a/ext/opcache/Optimizer/compact_literals.c b/ext/opcache/Optimizer/compact_literals.c index 091437e119..8fb5a9b0c9 100644 --- a/ext/opcache/Optimizer/compact_literals.c +++ b/ext/opcache/Optimizer/compact_literals.c @@ -227,10 +227,16 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx case ZEND_FETCH_CLASS: case ZEND_ADD_INTERFACE: case ZEND_ADD_TRAIT: + case ZEND_INSTANCEOF: if (ZEND_OP2_TYPE(opline) == IS_CONST) { LITERAL_INFO(opline->op2.constant, LITERAL_CLASS, 1, 1, 2); } break; + case ZEND_NEW: + if (ZEND_OP1_TYPE(opline) == IS_CONST) { + LITERAL_INFO(opline->op1.constant, LITERAL_CLASS, 1, 1, 2); + } + break; case ZEND_ASSIGN_OBJ: case ZEND_FETCH_OBJ_R: case ZEND_FETCH_OBJ_W: diff --git a/ext/opcache/Optimizer/nop_removal.c b/ext/opcache/Optimizer/nop_removal.c index 17cc838990..651950148c 100644 --- a/ext/opcache/Optimizer/nop_removal.c +++ b/ext/opcache/Optimizer/nop_removal.c @@ -97,6 +97,7 @@ void zend_optimizer_nop_removal(zend_op_array *op_array) case ZEND_FE_RESET: case ZEND_NEW: case ZEND_JMP_SET: + case ZEND_COALESCE: ZEND_OP2(opline).opline_num -= shiftlist[ZEND_OP2(opline).opline_num]; break; case ZEND_JMPZNZ: diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c index 3f3e72dc31..15bca2adf8 100644 --- a/ext/opcache/Optimizer/pass1_5.c +++ b/ext/opcache/Optimizer/pass1_5.c @@ -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_tmp_by_const(op_array, opline + 1, tv, &result TSRMLS_CC); + zend_optimizer_replace_by_const(op_array, opline + 1, IS_TMP_VAR, tv, &result TSRMLS_CC); } break; @@ -101,6 +101,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML opline->extended_value != IS_OBJECT && opline->extended_value != IS_RESOURCE) { /* cast of constant operand */ + zend_uchar type = opline->result_type; uint32_t tv = ZEND_RESULT(opline).var; /* temporary variable */ zval res; res = ZEND_OP1_LITERAL(opline); @@ -126,11 +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); - if (opline->result_type == IS_TMP_VAR) { - zend_optimizer_replace_tmp_by_const(op_array, opline + 1, tv, &res TSRMLS_CC); - } else /* if (opline->result_type == IS_VAR) */ { - zend_optimizer_replace_var_by_const(op_array, opline + 1, tv, &res TSRMLS_CC); - } + zend_optimizer_replace_by_const(op_array, opline + 1, type, tv, &res TSRMLS_CC); } else if (opline->extended_value == _IS_BOOL) { /* T = CAST(X, IS_BOOL) => T = BOOL(X) */ opline->opcode = ZEND_BOOL; @@ -157,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_tmp_by_const(op_array, opline + 1, tv, &result TSRMLS_CC); + zend_optimizer_replace_by_const(op_array, opline + 1, IS_TMP_VAR, tv, &result TSRMLS_CC); } break; @@ -251,7 +248,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_tmp_by_const(op_array, opline, tv, offset TSRMLS_CC); + zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, offset TSRMLS_CC); } EG(current_execute_data) = orig_execute_data; break; @@ -269,9 +266,12 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML break; } } + if (Z_TYPE(c) == IS_CONSTANT_AST) { + break; + } literal_dtor(&ZEND_OP2_LITERAL(opline)); MAKE_NOP(opline); - zend_optimizer_replace_tmp_by_const(op_array, opline, tv, &c TSRMLS_CC); + zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, &c TSRMLS_CC); } /* class constant */ @@ -315,6 +315,9 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML if ((c = zend_hash_find(&ce->constants_table, Z_STR(ZEND_OP2_LITERAL(opline)))) != NULL) { ZVAL_DEREF(c); + if (Z_TYPE_P(c) == IS_CONSTANT_AST) { + break; + } if (ZEND_IS_CONSTANT_TYPE(Z_TYPE_P(c))) { if (!zend_optimizer_get_persistent_constant(Z_STR_P(c), &t, 1 TSRMLS_CC) || ZEND_IS_CONSTANT_TYPE(Z_TYPE(t))) { @@ -332,34 +335,81 @@ 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_tmp_by_const(op_array, opline, tv, &t TSRMLS_CC); + zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, &t TSRMLS_CC); } } } break; - case ZEND_INIT_FCALL: + case ZEND_DO_FCALL: { + zend_op *send1_opline = opline - 1; + zend_op *send2_opline = NULL; + zend_op *init_opline = NULL; + + while (send1_opline->opcode == ZEND_NOP) { + send1_opline--; + } + if (send1_opline->opcode != ZEND_SEND_VAL || + ZEND_OP1_TYPE(send1_opline) != IS_CONST) { + /* don't colllect constants after unknown function call */ + collect_constants = 0; + break; + } + if (send1_opline->op2.num == 2) { + send2_opline = send1_opline; + send1_opline--; + while (send1_opline->opcode == ZEND_NOP) { + send1_opline--; + } + if (send1_opline->opcode != ZEND_SEND_VAL || + ZEND_OP1_TYPE(send1_opline) != IS_CONST) { + /* don't colllect constants after unknown function call */ + collect_constants = 0; + break; + } + } + init_opline = send1_opline - 1; + while (init_opline->opcode == ZEND_NOP) { + init_opline--; + } + if (init_opline->opcode != ZEND_INIT_FCALL || + ZEND_OP2_TYPE(init_opline) != IS_CONST || + Z_TYPE(ZEND_OP2_LITERAL(init_opline)) != IS_STRING) { + /* don't colllect constants after unknown function call */ + collect_constants = 0; + break; + } + /* define("name", scalar); */ - if (collect_constants && - ZEND_OP2_TYPE(opline) == IS_CONST && - Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_STRING && - Z_STRLEN(ZEND_OP2_LITERAL(opline)) == sizeof("define")-1 && - zend_binary_strcasecmp(Z_STRVAL(ZEND_OP2_LITERAL(opline)), Z_STRLEN(ZEND_OP2_LITERAL(opline)), "define", sizeof("define")-1) == 0) { + if (Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("define")-1 && + zend_binary_strcasecmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)), Z_STRLEN(ZEND_OP2_LITERAL(init_opline)), "define", sizeof("define")-1) == 0) { - if ((opline+1)->opcode == ZEND_SEND_VAL && - ZEND_OP1_TYPE(opline+1) == IS_CONST && - Z_TYPE(ZEND_OP1_LITERAL(opline+1)) == IS_STRING && - (opline+2)->opcode == ZEND_SEND_VAL && - ZEND_OP1_TYPE(opline+2) == IS_CONST && - Z_TYPE(ZEND_OP1_LITERAL(opline+2)) <= IS_STRING && - (opline+3)->opcode == ZEND_DO_FCALL) { - - zend_optimizer_collect_constant(ctx, &ZEND_OP1_LITERAL(opline+1), &ZEND_OP1_LITERAL(opline+2)); + if (Z_TYPE(ZEND_OP1_LITERAL(send1_opline)) == IS_STRING && + send2_opline && + Z_TYPE(ZEND_OP1_LITERAL(send2_opline)) <= IS_STRING) { + + if (collect_constants) { + zend_optimizer_collect_constant(ctx, &ZEND_OP1_LITERAL(send1_opline), &ZEND_OP1_LITERAL(send2_opline)); + } + + if (RESULT_UNUSED(opline) && + !zend_memnstr(Z_STRVAL(ZEND_OP1_LITERAL(send1_opline)), "::", sizeof("::") - 1, Z_STRVAL(ZEND_OP1_LITERAL(send1_opline)) + Z_STRLEN(ZEND_OP1_LITERAL(send1_opline)))) { + + opline->opcode = ZEND_DECLARE_CONST; + opline->op1_type = IS_CONST; + opline->op2_type = IS_CONST; + opline->result_type = IS_UNUSED; + opline->op1.constant = send1_opline->op1.constant; + opline->op2.constant = send2_opline->op1.constant; + opline->result.zv = NULL; + + literal_dtor(&ZEND_OP2_LITERAL(init_opline)); + MAKE_NOP(init_opline); + MAKE_NOP(send1_opline); + MAKE_NOP(send2_opline); + } break; } - } else { - /* don't colllect constants after any other function call */ - collect_constants = 0; } /* pre-evaluate constant functions: @@ -369,42 +419,42 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML is_callable(x) extension_loaded(x) */ - if ((opline + 1)->opcode == ZEND_SEND_VAL && - (opline + 2)->opcode == ZEND_DO_FCALL && - ZEND_OP1_TYPE(opline + 1) == IS_CONST && Z_TYPE(ZEND_OP1_LITERAL(opline + 1)) == IS_STRING && - ZEND_OP2_TYPE(opline) == IS_CONST && Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_STRING) { - if ((Z_STRLEN(ZEND_OP2_LITERAL(opline)) == sizeof("function_exists")-1 && - !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(opline)), + if (!send2_opline && + Z_TYPE(ZEND_OP1_LITERAL(send1_opline)) == IS_STRING) { + if ((Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("function_exists")-1 && + !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)), "function_exists", sizeof("function_exists")-1)) || - (Z_STRLEN(ZEND_OP2_LITERAL(opline)) == sizeof("is_callable")-1 && - !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(opline)), + (Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("is_callable")-1 && + !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)), "is_callable", sizeof("is_callable")))) { zend_internal_function *func; char *lc_name = zend_str_tolower_dup( - Z_STRVAL(ZEND_OP1_LITERAL(opline + 1)), Z_STRLEN(ZEND_OP1_LITERAL(opline + 1))); + Z_STRVAL(ZEND_OP1_LITERAL(send1_opline)), Z_STRLEN(ZEND_OP1_LITERAL(send1_opline))); - if ((func = zend_hash_str_find_ptr(EG(function_table), lc_name, Z_STRLEN(ZEND_OP1_LITERAL(opline + 1)))) != NULL && + if ((func = zend_hash_str_find_ptr(EG(function_table), lc_name, Z_STRLEN(ZEND_OP1_LITERAL(send1_opline)))) != NULL && func->type == ZEND_INTERNAL_FUNCTION && func->module->type == MODULE_PERSISTENT) { zval t; ZVAL_BOOL(&t, 1); - if (zend_optimizer_replace_var_by_const(op_array, opline + 3, ZEND_RESULT(opline + 2).var, &t TSRMLS_CC)) { - literal_dtor(&ZEND_OP2_LITERAL(opline)); + if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC)) { + literal_dtor(&ZEND_OP2_LITERAL(init_opline)); + MAKE_NOP(init_opline); + literal_dtor(&ZEND_OP1_LITERAL(send1_opline)); + MAKE_NOP(send1_opline); MAKE_NOP(opline); - literal_dtor(&ZEND_OP1_LITERAL(opline + 1)); - MAKE_NOP(opline + 1); - MAKE_NOP(opline + 2); + efree(lc_name); + break; } } efree(lc_name); - } else if (Z_STRLEN(ZEND_OP2_LITERAL(opline)) == sizeof("extension_loaded")-1 && - !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(opline)), + } else if (Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("extension_loaded")-1 && + !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)), "extension_loaded", sizeof("extension_loaded")-1)) { zval t; char *lc_name = zend_str_tolower_dup( - Z_STRVAL(ZEND_OP1_LITERAL(opline + 1)), Z_STRLEN(ZEND_OP1_LITERAL(opline + 1))); + Z_STRVAL(ZEND_OP1_LITERAL(send1_opline)), Z_STRLEN(ZEND_OP1_LITERAL(send1_opline))); zend_module_entry *m = zend_hash_str_find_ptr(&module_registry, - lc_name, Z_STRLEN(ZEND_OP1_LITERAL(opline + 1))); + lc_name, Z_STRLEN(ZEND_OP1_LITERAL(send1_opline))); efree(lc_name); if (!m) { @@ -421,67 +471,96 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML } } - if (zend_optimizer_replace_var_by_const(op_array, opline + 3, ZEND_RESULT(opline + 2).var, &t TSRMLS_CC)) { - literal_dtor(&ZEND_OP2_LITERAL(opline)); + if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC)) { + literal_dtor(&ZEND_OP2_LITERAL(init_opline)); + MAKE_NOP(init_opline); + literal_dtor(&ZEND_OP1_LITERAL(send1_opline)); + MAKE_NOP(send1_opline); MAKE_NOP(opline); - literal_dtor(&ZEND_OP1_LITERAL(opline + 1)); - MAKE_NOP(opline + 1); - MAKE_NOP(opline + 2); + break; } - } else if (Z_STRLEN(ZEND_OP2_LITERAL(opline)) == sizeof("defined")-1 && - !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(opline)), + } else if (Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("defined")-1 && + !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)), "defined", sizeof("defined")-1)) { zval t; - if (zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(opline + 1)), &t, 0 TSRMLS_CC)) { + if (zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(send1_opline)), &t, 0 TSRMLS_CC)) { ZVAL_BOOL(&t, 1); - if (zend_optimizer_replace_var_by_const(op_array, opline + 3, ZEND_RESULT(opline + 2).var, &t TSRMLS_CC)) { - literal_dtor(&ZEND_OP2_LITERAL(opline)); + if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC)) { + literal_dtor(&ZEND_OP2_LITERAL(init_opline)); + MAKE_NOP(init_opline); + literal_dtor(&ZEND_OP1_LITERAL(send1_opline)); + MAKE_NOP(send1_opline); MAKE_NOP(opline); - literal_dtor(&ZEND_OP1_LITERAL(opline + 1)); - MAKE_NOP(opline + 1); - MAKE_NOP(opline + 2); + break; } } - } else if (Z_STRLEN(ZEND_OP2_LITERAL(opline)) == sizeof("constant")-1 && - !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(opline)), + } else if (Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("constant")-1 && + !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)), "constant", sizeof("constant")-1)) { zval t; - if (zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(opline + 1)), &t, 1 TSRMLS_CC)) { - if (zend_optimizer_replace_var_by_const(op_array, opline + 3, ZEND_RESULT(opline + 2).var, &t TSRMLS_CC)) { - literal_dtor(&ZEND_OP2_LITERAL(opline)); + 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)) { + literal_dtor(&ZEND_OP2_LITERAL(init_opline)); + MAKE_NOP(init_opline); + literal_dtor(&ZEND_OP1_LITERAL(send1_opline)); + MAKE_NOP(send1_opline); MAKE_NOP(opline); - literal_dtor(&ZEND_OP1_LITERAL(opline + 1)); - MAKE_NOP(opline + 1); - MAKE_NOP(opline + 2); + break; } } } else if ((CG(compiler_options) & ZEND_COMPILE_NO_BUILTIN_STRLEN) == 0 && - Z_STRLEN(ZEND_OP2_LITERAL(opline)) == sizeof("strlen")-1 && - !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(opline)), + Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("strlen")-1 && + !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)), "strlen", sizeof("strlen")-1)) { zval t; - ZVAL_LONG(&t, Z_STRLEN(ZEND_OP1_LITERAL(opline + 1))); - if (zend_optimizer_replace_var_by_const(op_array, opline + 3, ZEND_RESULT(opline + 2).var, &t TSRMLS_CC)) { - literal_dtor(&ZEND_OP2_LITERAL(opline)); + 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)) { + literal_dtor(&ZEND_OP2_LITERAL(init_opline)); + MAKE_NOP(init_opline); + literal_dtor(&ZEND_OP1_LITERAL(send1_opline)); + MAKE_NOP(send1_opline); MAKE_NOP(opline); - literal_dtor(&ZEND_OP1_LITERAL(opline + 1)); - MAKE_NOP(opline + 1); - MAKE_NOP(opline + 2); + break; + } + /* dirname(IS_CONST/IS_STRING) -> IS_CONST/IS_STRING */ + } else if (Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("dirname")-1 && + !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)), + "dirname", sizeof("dirname")-1) && + IS_ABSOLUTE_PATH(Z_STRVAL(ZEND_OP1_LITERAL(send1_opline)), Z_STRLEN(ZEND_OP1_LITERAL(send1_opline)))) { + zend_string *dirname = zend_string_init(Z_STRVAL(ZEND_OP1_LITERAL(send1_opline)), Z_STRLEN(ZEND_OP1_LITERAL(send1_opline)), 0); + dirname->len = zend_dirname(dirname->val, dirname->len); + if (IS_ABSOLUTE_PATH(dirname->val, dirname->len)) { + 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)) { + literal_dtor(&ZEND_OP2_LITERAL(init_opline)); + MAKE_NOP(init_opline); + literal_dtor(&ZEND_OP1_LITERAL(send1_opline)); + MAKE_NOP(send1_opline); + MAKE_NOP(opline); + break; + } + } else { + zend_string_release(dirname); } } } + /* don't colllect constants after any other function call */ + collect_constants = 0; break; + } case ZEND_STRLEN: if (ZEND_OP1_TYPE(opline) == IS_CONST && Z_TYPE(ZEND_OP1_LITERAL(opline)) == IS_STRING) { zval t; ZVAL_LONG(&t, Z_STRLEN(ZEND_OP1_LITERAL(opline))); - zend_optimizer_replace_tmp_by_const(op_array, opline + 1, ZEND_RESULT(opline).var, &t TSRMLS_CC); + zend_optimizer_replace_by_const(op_array, opline + 1, IS_TMP_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC); literal_dtor(&ZEND_OP1_LITERAL(opline)); MAKE_NOP(opline); } @@ -494,7 +573,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML break; } ZVAL_TRUE(&c); - zend_optimizer_replace_tmp_by_const(op_array, opline, tv, &c TSRMLS_CC); + zend_optimizer_replace_by_const(op_array, opline, IS_TMP_VAR, tv, &c TSRMLS_CC); literal_dtor(&ZEND_OP1_LITERAL(opline)); MAKE_NOP(opline); } @@ -527,8 +606,8 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML case ZEND_FE_RESET: case ZEND_FE_FETCH: case ZEND_NEW: - case ZEND_DO_FCALL: case ZEND_JMP_SET: + case ZEND_COALESCE: collect_constants = 0; break; case ZEND_FETCH_R: diff --git a/ext/opcache/Optimizer/pass2.c b/ext/opcache/Optimizer/pass2.c index 5fa6560d48..859bc2f3bc 100644 --- a/ext/opcache/Optimizer/pass2.c +++ b/ext/opcache/Optimizer/pass2.c @@ -205,8 +205,7 @@ void zend_optimizer_pass2(zend_op_array *op_array TSRMLS_DC) array_offset = jmp_to->parent; if (--nest_levels > 0) { if (opline->opcode == ZEND_BRK && - (op_array->opcodes[jmp_to->brk].opcode == ZEND_FREE || - op_array->opcodes[jmp_to->brk].opcode == ZEND_SWITCH_FREE)) { + op_array->opcodes[jmp_to->brk].opcode == ZEND_FREE) { dont_optimize = 1; break; } diff --git a/ext/opcache/Optimizer/pass3.c b/ext/opcache/Optimizer/pass3.c index 345e347a5b..8d8cb50580 100644 --- a/ext/opcache/Optimizer/pass3.c +++ b/ext/opcache/Optimizer/pass3.c @@ -182,6 +182,7 @@ void zend_optimizer_pass3(zend_op_array *op_array TSRMLS_DC) break; case ZEND_JMP_SET: + case ZEND_COALESCE: if (op_array->fn_flags & ZEND_ACC_HAS_FINALLY_BLOCK) { break; } diff --git a/ext/opcache/Optimizer/zend_optimizer.c b/ext/opcache/Optimizer/zend_optimizer.c index f31ce38cfe..1a6d0b675a 100644 --- a/ext/opcache/Optimizer/zend_optimizer.c +++ b/ext/opcache/Optimizer/zend_optimizer.c @@ -126,6 +126,7 @@ void zend_optimizer_update_op1_const(zend_op_array *op_array, case ZEND_CATCH: case ZEND_FETCH_CONSTANT: case ZEND_DEFINED: + case ZEND_NEW: opline->op1.constant = zend_optimizer_add_literal(op_array, val TSRMLS_CC); zend_string_hash_val(Z_STR(ZEND_OP1_LITERAL(opline))); Z_CACHE_SLOT(op_array->literals[opline->op1.constant]) = op_array->last_cache_slot++; @@ -173,6 +174,7 @@ void zend_optimizer_update_op2_const(zend_op_array *op_array, case ZEND_ISSET_ISEMPTY_VAR: case ZEND_ADD_INTERFACE: case ZEND_ADD_TRAIT: + 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); @@ -244,7 +246,7 @@ void zend_optimizer_update_op2_const(zend_op_array *op_array, case ZEND_FETCH_DIM_IS: case ZEND_FETCH_DIM_FUNC_ARG: case ZEND_FETCH_DIM_UNSET: - case ZEND_FETCH_DIM_TMP_VAR: + case ZEND_FETCH_LIST: check_numeric: { zend_ulong index; @@ -262,15 +264,16 @@ check_numeric: } } -int zend_optimizer_replace_var_by_const(zend_op_array *op_array, - zend_op *opline, - uint32_t var, - zval *val TSRMLS_DC) +int zend_optimizer_replace_by_const(zend_op_array *op_array, + zend_op *opline, + zend_uchar type, + uint32_t var, + zval *val TSRMLS_DC) { zend_op *end = op_array->opcodes + op_array->last; while (opline < end) { - if (ZEND_OP1_TYPE(opline) == IS_VAR && + if (ZEND_OP1_TYPE(opline) == type && ZEND_OP1(opline).var == var) { switch (opline->opcode) { case ZEND_FETCH_DIM_W: @@ -292,6 +295,25 @@ int zend_optimizer_replace_var_by_const(zend_op_array *op_array, opline->opcode = ZEND_SEND_VAL; } break; + /* In most cases IS_TMP_VAR operand may be used only once. + * The operands are usually destroyed by the opcode handler. + * ZEND_CASE is an exception, that keeps operand unchanged, + * and allows its reuse. The number of ZEND_CASE instructions + * usually terminated by ZEND_FREE that finally kills the value. + */ + case ZEND_CASE: { + zval old_val; + ZVAL_COPY_VALUE(&old_val, val); + zval_copy_ctor(val); + zend_optimizer_update_op1_const(op_array, opline, val TSRMLS_CC); + ZVAL_COPY_VALUE(val, &old_val); + opline++; + continue; + } + case ZEND_FREE: + MAKE_NOP(opline); + zval_dtor(val); + return 1; default: break; } @@ -299,7 +321,7 @@ int zend_optimizer_replace_var_by_const(zend_op_array *op_array, break; } - if (ZEND_OP2_TYPE(opline) == IS_VAR && + if (ZEND_OP2_TYPE(opline) == type && ZEND_OP2(opline).var == var) { switch (opline->opcode) { case ZEND_ASSIGN_REF: @@ -316,55 +338,6 @@ int zend_optimizer_replace_var_by_const(zend_op_array *op_array, return 1; } -void zend_optimizer_replace_tmp_by_const(zend_op_array *op_array, - zend_op *opline, - uint32_t var, - zval *val - TSRMLS_DC) -{ - zend_op *end = op_array->opcodes + op_array->last; - - while (opline < end) { - if (ZEND_OP1_TYPE(opline) == IS_TMP_VAR && - ZEND_OP1(opline).var == var) { - - /* In most cases IS_TMP_VAR operand may be used only once. - * The operands are usually destroyed by the opcode handler. - * ZEND_CASE is an exception, that keeps operand unchanged, - * and allows its reuse. The number of ZEND_CASE instructions - * usually terminated by ZEND_FREE that finally kills the value. - */ - if (opline->opcode == ZEND_CASE) { - zval old_val; - ZVAL_COPY_VALUE(&old_val, val); - zval_copy_ctor(val); - zend_optimizer_update_op1_const(op_array, opline, val TSRMLS_CC); - ZVAL_COPY_VALUE(val, &old_val); - } else if (opline->opcode == ZEND_FREE) { - MAKE_NOP(opline); - break; - } else { - zend_optimizer_update_op1_const(op_array, opline, val TSRMLS_CC); - val = NULL; - break; - } - } - - if (ZEND_OP2_TYPE(opline) == IS_TMP_VAR && - ZEND_OP2(opline).var == var) { - - zend_optimizer_update_op2_const(op_array, opline, val TSRMLS_CC); - /* TMP_VAR may be used only once */ - val = NULL; - break; - } - opline++; - } - if (val) { - zval_dtor(val); - } -} - static void zend_optimize(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS_DC) { @@ -467,6 +440,7 @@ static void zend_accel_optimize(zend_op_array *op_array, case ZEND_JMPZ_EX: case ZEND_JMPNZ_EX: case ZEND_JMP_SET: + case ZEND_COALESCE: case ZEND_NEW: case ZEND_FE_RESET: case ZEND_FE_FETCH: @@ -504,6 +478,7 @@ static void zend_accel_optimize(zend_op_array *op_array, case ZEND_JMPZ_EX: case ZEND_JMPNZ_EX: case ZEND_JMP_SET: + case ZEND_COALESCE: case ZEND_NEW: case ZEND_FE_RESET: case ZEND_FE_FETCH: diff --git a/ext/opcache/Optimizer/zend_optimizer_internal.h b/ext/opcache/Optimizer/zend_optimizer_internal.h index ac87cf9f35..ba91b147c9 100644 --- a/ext/opcache/Optimizer/zend_optimizer_internal.h +++ b/ext/opcache/Optimizer/zend_optimizer_internal.h @@ -112,14 +112,11 @@ void zend_optimizer_update_op1_const(zend_op_array *op_array, void zend_optimizer_update_op2_const(zend_op_array *op_array, zend_op *opline, zval *val TSRMLS_DC); -int zend_optimizer_replace_var_by_const(zend_op_array *op_array, - zend_op *opline, - uint32_t var, - zval *val TSRMLS_DC); -void zend_optimizer_replace_tmp_by_const(zend_op_array *op_array, - zend_op *opline, - uint32_t var, - zval *val TSRMLS_DC); +int zend_optimizer_replace_by_const(zend_op_array *op_array, + zend_op *opline, + zend_uchar type, + uint32_t var, + zval *val TSRMLS_DC); 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); diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index e210a46210..b5d446a54b 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -384,6 +384,9 @@ static void accel_use_shm_interned_strings(TSRMLS_D) if (p->key) { p->key = accel_new_interned_string(p->key TSRMLS_CC); } + 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); + } } /* class table hash keys, class names, properties, methods, constants, etc */ @@ -425,6 +428,9 @@ static void accel_use_shm_interned_strings(TSRMLS_D) if (q->key) { q->key = accel_new_interned_string(q->key TSRMLS_CC); } + 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); + } } for (j = 0; j < ce->constants_table.nNumUsed; j++) { @@ -1121,10 +1127,6 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr return new_persistent_script; } - if (!compact_persistent_script(new_persistent_script)) { - return new_persistent_script; - } - /* exclusive lock */ zend_shared_alloc_lock(TSRMLS_C); @@ -1165,10 +1167,6 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr return new_persistent_script; } - /* cleanup after calculation */ - new_persistent_script->mem = ZCG(mem); - new_persistent_script->size = memory_used; - /* Copy into shared memory */ new_persistent_script = zend_accel_script_persist(new_persistent_script, &key, key_length TSRMLS_CC); diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h index c3c7285c48..28c3d21102 100644 --- a/ext/opcache/ZendAccelerator.h +++ b/ext/opcache/ZendAccelerator.h @@ -164,6 +164,8 @@ typedef struct _zend_persistent_script { void *mem; /* shared memory area used by script structures */ size_t size; /* size of used shared memory */ + void *arena_mem; /* part that should be copied into process */ + size_t arena_size; /* All entries that shouldn't be counted in the ADLER32 * checksum must be declared in this struct @@ -234,6 +236,8 @@ typedef struct _zend_accel_globals { time_t request_time; /* preallocated shared-memory block to save current script */ void *mem; + void *arena_mem; + zend_persistent_script *current_persistent_script; /* cache to save hash lookup on the same INCLUDE opcode */ const zend_op *cache_opline; zend_persistent_script *cache_persistent_script; diff --git a/ext/opcache/tests/bug68104.phpt b/ext/opcache/tests/bug68104.phpt new file mode 100644 index 0000000000..8d3bf70a4d --- /dev/null +++ b/ext/opcache/tests/bug68104.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #68104 (Segfault while pre-evaluating a disabled function) +--CREDITS-- +manuel <manuel@mausz.at> +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +disable_functions=dl +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php +var_dump(is_callable("dl")); +dl("a.so"); +?> +--EXPECTF-- +bool(true) + +Warning: dl() has been disabled for security reasons in %sbug68104.php on line %d diff --git a/ext/opcache/tests/bug68252.phpt b/ext/opcache/tests/bug68252.phpt new file mode 100644 index 0000000000..e05467a244 --- /dev/null +++ b/ext/opcache/tests/bug68252.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #68252 (segfault in Zend/zend_hash.c in function _zend_hash_del_el) +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.fast_shutdown=1 +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +--FILE-- +<?php +/* run this test script with valgrind */ +function a() { + echo "okey"; +} + +create_function('', 'var_dump("22");'); + +a(); +--EXPECT-- +okey diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index 001c3ee9ed..fcaf96408c 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -499,7 +499,7 @@ static int accelerator_get_scripts(zval *return_value TSRMLS_DC) timerclear(&exec_time); timerclear(&fetch_time); - zend_hash_str_update(Z_ARRVAL_P(return_value), cache_entry->key, cache_entry->key_length-1, &persistent_script_report); + 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); diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index 5dbb48237d..22683245f6 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -38,6 +38,9 @@ static uint32_t zend_accel_refcount = ZEND_PROTECTED_REFCOUNT; # define accel_xlat_get(old, new) ((new) = zend_hash_str_find_ptr(&ZCG(bind_hash), (char*)&(old), sizeof(void*), (zend_ulong)(zend_uintptr_t)(old), (void**)&(new))) #endif +#define ARENA_REALLOC(ptr) \ + (void*)(((char*)(ptr)) + ((char*)ZCG(arena_mem) - (char*)ZCG(current_persistent_script)->arena_mem)) + typedef int (*id_function_t)(void *, void *); typedef void (*unique_copy_ctor_func_t)(void *pElement); @@ -75,7 +78,7 @@ zend_persistent_script* create_persistent_script(void) zend_persistent_script *persistent_script = (zend_persistent_script *) emalloc(sizeof(zend_persistent_script)); memset(persistent_script, 0, sizeof(zend_persistent_script)); - zend_hash_init(&persistent_script->function_table, 128, NULL, (dtor_func_t) zend_accel_destroy_zend_function, 0); + zend_hash_init(&persistent_script->function_table, 128, NULL, ZEND_FUNCTION_DTOR, 0); /* class_table is usually destroyed by free_persistent_script() that * overrides destructor. ZEND_CLASS_DTOR may be used by standard * PHP compiler @@ -85,64 +88,6 @@ zend_persistent_script* create_persistent_script(void) return persistent_script; } -static int compact_hash_table(HashTable *ht) -{ - uint i = 3; - uint j; - uint nSize; - Bucket *d; - Bucket *p; - - if (!ht->nNumOfElements || (ht->u.flags & HASH_FLAG_PACKED)) { - /* Empty tables don't allocate space for Buckets */ - return 1; - } - - if (ht->nNumOfElements >= 0x80000000) { - /* prevent overflow */ - nSize = 0x80000000; - } else { - while ((1U << i) < ht->nNumOfElements) { - i++; - } - nSize = 1 << i; - } - - if (nSize >= ht->nTableSize) { - /* Keep the size */ - return 1; - } - - d = (Bucket *)pemalloc(nSize * (sizeof(Bucket) + sizeof(uint32_t)), ht->u.flags & HASH_FLAG_PERSISTENT); - if (!d) { - return 0; - } - - for (i = 0, j = 0; i < ht->nNumUsed; i++) { - p = ht->arData + i; - if (Z_TYPE(p->val) != IS_UNDEF) { - d[j++] = *p; - } - } - ht->nNumUsed = j; - - pefree(ht->arData, ht->u.flags & HASH_FLAG_PERSISTENT); - - ht->arData = d; - ht->arHash = (uint32_t *)(d + nSize); - ht->nTableSize = nSize; - ht->nTableMask = ht->nTableSize - 1; - zend_hash_rehash(ht); - - return 1; -} - -int compact_persistent_script(zend_persistent_script *persistent_script) -{ - return compact_hash_table(&persistent_script->function_table) && - compact_hash_table(&persistent_script->class_table); -} - void free_persistent_script(zend_persistent_script *persistent_script, int destroy_elements) { if (destroy_elements) { @@ -469,9 +414,8 @@ static void zend_hash_clone_methods(HashTable *ht, HashTable *source, zend_class q->key = zend_clone_str(p->key TSRMLS_CC); /* Copy data */ - ZVAL_PTR(&q->val, (void *) zend_arena_alloc(&CG(arena), sizeof(zend_op_array))); + ZVAL_PTR(&q->val, ARENA_REALLOC(Z_PTR(p->val))); new_entry = (zend_op_array*)Z_PTR(q->val); - *new_entry = *(zend_op_array*)Z_PTR(p->val); /* Copy constructor */ /* we use refcount to show that op_array is referenced from several places */ @@ -546,9 +490,8 @@ static void zend_hash_clone_prop_info(HashTable *ht, HashTable *source, zend_cla q->key = zend_clone_str(p->key TSRMLS_CC); /* Copy data */ - ZVAL_PTR(&q->val, (void *) zend_arena_alloc(&CG(arena), sizeof(zend_property_info))); + ZVAL_PTR(&q->val, ARENA_REALLOC(Z_PTR(p->val))); prop_info = Z_PTR(q->val); - *prop_info = *(zend_property_info*)Z_PTR(p->val); /* Copy constructor */ prop_info->name = zend_clone_str(prop_info->name TSRMLS_CC); @@ -607,8 +550,7 @@ static void zend_class_copy_ctor(zend_class_entry **pce) zend_function *new_func; TSRMLS_FETCH(); - *pce = ce = zend_arena_alloc(&CG(arena), sizeof(zend_class_entry)); - *ce = *old_ce; + *pce = ce = ARENA_REALLOC(old_ce); ce->refcount = 1; if (old_ce->refcount != 1) { @@ -799,8 +741,7 @@ static void zend_accel_function_hash_copy(HashTable *target, HashTable *source, } } if (pCopyConstructor) { - Z_PTR_P(t) = zend_arena_alloc(&CG(arena), sizeof(zend_op_array)); - memcpy(Z_PTR_P(t), Z_PTR(p->val), sizeof(zend_op_array)); + Z_PTR_P(t) = ARENA_REALLOC(Z_PTR(p->val)); pCopyConstructor(Z_PTR_P(t)); } } @@ -876,9 +817,16 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, op_array = (zend_op_array *) emalloc(sizeof(zend_op_array)); *op_array = persistent_script->main_op_array; - if (from_shared_memory) { + if (EXPECTED(from_shared_memory)) { zend_hash_init(&ZCG(bind_hash), 10, NULL, NULL, 0); + ZCG(current_persistent_script) = persistent_script; + ZCG(arena_mem) = NULL; + if (EXPECTED(persistent_script->arena_size)) { + ZCG(arena_mem) = zend_arena_alloc(&CG(arena), persistent_script->arena_size); + memcpy(ZCG(arena_mem), persistent_script->arena_mem, persistent_script->arena_size); + } + /* 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); @@ -905,6 +853,7 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, } zend_hash_destroy(&ZCG(bind_hash)); + ZCG(current_persistent_script) = NULL; } else /* if (!from_shared_memory) */ { if (zend_hash_num_elements(&persistent_script->function_table) > 0) { zend_accel_function_hash_copy(CG(function_table), &persistent_script->function_table, NULL TSRMLS_CC); @@ -921,7 +870,7 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, CG(compiled_filename) = orig_compiled_filename; } - if (!from_shared_memory) { + if (UNEXPECTED(!from_shared_memory)) { free_persistent_script(persistent_script, 0); /* free only hashes */ } diff --git a/ext/opcache/zend_accelerator_util_funcs.h b/ext/opcache/zend_accelerator_util_funcs.h index 2f515d85cc..cbcb2ffa8e 100644 --- a/ext/opcache/zend_accelerator_util_funcs.h +++ b/ext/opcache/zend_accelerator_util_funcs.h @@ -28,7 +28,6 @@ void zend_accel_copy_internal_functions(TSRMLS_D); zend_persistent_script* create_persistent_script(void); -int compact_persistent_script(zend_persistent_script *script); void free_persistent_script(zend_persistent_script *persistent_script, int destroy_elements); void zend_accel_free_user_functions(HashTable *ht TSRMLS_DC); diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index 05fbd4fc75..3e91740a71 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -373,6 +373,7 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc case ZEND_JMPZ_EX: case ZEND_JMPNZ_EX: case ZEND_JMP_SET: + case ZEND_COALESCE: case ZEND_NEW: case ZEND_FE_RESET: case ZEND_FE_FETCH: @@ -485,7 +486,10 @@ 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) { - Z_PTR_P(zv) = zend_accel_memdup(Z_PTR_P(zv), sizeof(zend_op_array)); + 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); } @@ -493,7 +497,10 @@ static void zend_persist_property_info(zval *zv TSRMLS_DC) { zend_property_info *prop; - prop = Z_PTR_P(zv) = zend_accel_memdup(Z_PTR_P(zv), sizeof(zend_property_info)); + memcpy(ZCG(arena_mem), Z_PTR_P(zv), sizeof(zend_property_info)); + zend_shared_alloc_register_xlat_entry(Z_PTR_P(zv), ZCG(arena_mem)); + prop = Z_PTR_P(zv) = ZCG(arena_mem); + ZCG(arena_mem) = (void*)((char*)ZCG(arena_mem) + ZEND_ALIGNED_SIZE(sizeof(zend_property_info))); zend_accel_store_interned_string(prop->name); if (prop->doc_comment) { if (ZCG(accel_directives).save_comments) { @@ -513,7 +520,10 @@ static void zend_persist_class_entry(zval *zv TSRMLS_DC) zend_class_entry *ce = Z_PTR_P(zv); if (ce->type == ZEND_USER_CLASS) { - ce = Z_PTR_P(zv) = zend_accel_memdup(ce, sizeof(zend_class_entry)); + memcpy(ZCG(arena_mem), Z_PTR_P(zv), sizeof(zend_class_entry)); + zend_shared_alloc_register_xlat_entry(Z_PTR_P(zv), ZCG(arena_mem)); + 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); if (ce->default_properties_table) { @@ -702,13 +712,20 @@ static void zend_accel_persist_class_table(HashTable *class_table TSRMLS_DC) zend_persistent_script *zend_accel_script_persist(zend_persistent_script *script, char **key, unsigned int key_length TSRMLS_DC) { + script->mem = ZCG(mem); + zend_shared_alloc_clear_xlat_table(); - zend_hash_persist(&script->function_table, zend_persist_op_array TSRMLS_CC); - zend_accel_persist_class_table(&script->class_table TSRMLS_CC); - zend_persist_op_array_ex(&script->main_op_array, script TSRMLS_CC); + + zend_accel_store(script, sizeof(zend_persistent_script)); *key = zend_accel_memdup(*key, key_length + 1); zend_accel_store_string(script->full_path); - zend_accel_store(script, sizeof(zend_persistent_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); return script; } diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c index d2de94f05c..0a7b835648 100644 --- a/ext/opcache/zend_persist_calc.c +++ b/ext/opcache/zend_persist_calc.c @@ -26,10 +26,10 @@ #include "zend_shared_alloc.h" #include "zend_operators.h" -#define START_SIZE() uint memory_used = 0 -#define ADD_DUP_SIZE(m,s) memory_used += zend_shared_memdup_size((void*)m, s) -#define ADD_SIZE(m) memory_used += ZEND_ALIGNED_SIZE(m) -#define RETURN_SIZE() return memory_used +#define ADD_DUP_SIZE(m,s) ZCG(current_persistent_script)->size += zend_shared_memdup_size((void*)m, s) +#define ADD_SIZE(m) ZCG(current_persistent_script)->size += ZEND_ALIGNED_SIZE(m) + +#define ADD_ARENA_SIZE(m) ZCG(current_persistent_script)->arena_size += ZEND_ALIGNED_SIZE(m) # define ADD_STRING(str) \ ADD_DUP_SIZE((str), _STR_HEADER_SIZE + (str)->len + 1) @@ -47,16 +47,15 @@ } \ } while (0) -static uint zend_persist_zval_calc(zval *z TSRMLS_DC); +static void zend_persist_zval_calc(zval *z TSRMLS_DC); -static uint zend_hash_persist_calc(HashTable *ht, uint (*pPersistElement)(zval *pElement TSRMLS_DC) TSRMLS_DC) +static void zend_hash_persist_calc(HashTable *ht, void (*pPersistElement)(zval *pElement TSRMLS_DC) TSRMLS_DC) { uint idx; Bucket *p; - START_SIZE(); if (!ht->nTableMask) { - RETURN_SIZE(); + return; } if (ht->u.flags & HASH_FLAG_PACKED) { ADD_SIZE(sizeof(Bucket) * ht->nNumUsed); @@ -75,26 +74,23 @@ static uint zend_hash_persist_calc(HashTable *ht, uint (*pPersistElement)(zval * GC_FLAGS(p->key) |= flags; } - ADD_SIZE(pPersistElement(&p->val TSRMLS_CC)); + pPersistElement(&p->val TSRMLS_CC); } - - RETURN_SIZE(); } -static uint zend_persist_ast_calc(zend_ast *ast TSRMLS_DC) +static void zend_persist_ast_calc(zend_ast *ast TSRMLS_DC) { uint32_t i; - START_SIZE(); if (ast->kind == ZEND_AST_ZVAL) { ADD_SIZE(sizeof(zend_ast_zval)); - ADD_SIZE(zend_persist_zval_calc(zend_ast_get_zval(ast) TSRMLS_CC)); + zend_persist_zval_calc(zend_ast_get_zval(ast) TSRMLS_CC); } 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]) { - ADD_SIZE(zend_persist_ast_calc(list->child[i] TSRMLS_CC)); + zend_persist_ast_calc(list->child[i] TSRMLS_CC); } } } else { @@ -102,18 +98,16 @@ static uint 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]) { - ADD_SIZE(zend_persist_ast_calc(ast->child[i] TSRMLS_CC)); + zend_persist_ast_calc(ast->child[i] TSRMLS_CC); } } } - RETURN_SIZE(); } -static uint zend_persist_zval_calc(zval *z TSRMLS_DC) +static void zend_persist_zval_calc(zval *z TSRMLS_DC) { zend_uchar flags; uint size; - START_SIZE(); switch (Z_TYPE_P(z)) { case IS_STRING: @@ -129,38 +123,35 @@ static uint 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); - ADD_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 TSRMLS_CC); } break; case IS_REFERENCE: size = zend_shared_memdup_size(Z_REF_P(z), sizeof(zend_reference)); if (size) { ADD_SIZE(size); - ADD_SIZE(zend_persist_zval_calc(Z_REFVAL_P(z) TSRMLS_CC)); + zend_persist_zval_calc(Z_REFVAL_P(z) TSRMLS_CC); } break; case IS_CONSTANT_AST: size = zend_shared_memdup_size(Z_AST_P(z), sizeof(zend_ast_ref)); if (size) { ADD_SIZE(size); - ADD_SIZE(zend_persist_ast_calc(Z_ASTVAL_P(z) TSRMLS_CC)); + zend_persist_ast_calc(Z_ASTVAL_P(z) TSRMLS_CC); } break; } - RETURN_SIZE(); } -static uint 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 TSRMLS_DC) { - START_SIZE(); - if (op_array->type != ZEND_USER_FUNCTION) { - return 0; + return; } if (op_array->static_variables) { ADD_DUP_SIZE(op_array->static_variables, sizeof(HashTable)); - ADD_SIZE(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 TSRMLS_CC); } if (zend_shared_alloc_get_xlat_entry(op_array->opcodes)) { @@ -171,7 +162,7 @@ static uint zend_persist_op_array_calc_ex(zend_op_array *op_array TSRMLS_DC) op_array->function_name = new_name; } } - RETURN_SIZE(); + return; } if (op_array->literals) { @@ -179,7 +170,7 @@ static uint 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) { - ADD_SIZE(zend_persist_zval_calc(p TSRMLS_CC)); + zend_persist_zval_calc(p TSRMLS_CC); p++; } } @@ -239,46 +230,39 @@ static uint zend_persist_op_array_calc_ex(zend_op_array *op_array TSRMLS_DC) ADD_INTERNED_STRING(op_array->vars[i], 0); } } - - RETURN_SIZE(); } -static uint zend_persist_op_array_calc(zval *zv TSRMLS_DC) +static void zend_persist_op_array_calc(zval *zv TSRMLS_DC) { - START_SIZE(); - ADD_SIZE(sizeof(zend_op_array)); - ADD_SIZE(zend_persist_op_array_calc_ex(Z_PTR_P(zv) TSRMLS_CC)); - RETURN_SIZE(); + ADD_ARENA_SIZE(sizeof(zend_op_array)); + zend_persist_op_array_calc_ex(Z_PTR_P(zv) TSRMLS_CC); } -static uint zend_persist_property_info_calc(zval *zv TSRMLS_DC) +static void zend_persist_property_info_calc(zval *zv TSRMLS_DC) { zend_property_info *prop = Z_PTR_P(zv); - START_SIZE(); - ADD_SIZE(sizeof(zend_property_info)); + ADD_ARENA_SIZE(sizeof(zend_property_info)); ADD_INTERNED_STRING(prop->name, 0); if (ZCG(accel_directives).save_comments && prop->doc_comment) { ADD_STRING(prop->doc_comment); } - RETURN_SIZE(); } -static uint zend_persist_class_entry_calc(zval *zv TSRMLS_DC) +static void zend_persist_class_entry_calc(zval *zv TSRMLS_DC) { zend_class_entry *ce = Z_PTR_P(zv); - START_SIZE(); if (ce->type == ZEND_USER_CLASS) { - ADD_DUP_SIZE(ce, sizeof(zend_class_entry)); + ADD_ARENA_SIZE(sizeof(zend_class_entry)); ADD_INTERNED_STRING(ce->name, 0); - ADD_SIZE(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 TSRMLS_CC); if (ce->default_properties_table) { int i; ADD_SIZE(sizeof(zval) * ce->default_properties_count); for (i = 0; i < ce->default_properties_count; i++) { - ADD_SIZE(zend_persist_zval_calc(&ce->default_properties_table[i] TSRMLS_CC)); + zend_persist_zval_calc(&ce->default_properties_table[i] TSRMLS_CC); } } if (ce->default_static_members_table) { @@ -286,10 +270,10 @@ static uint 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++) { - ADD_SIZE(zend_persist_zval_calc(&ce->default_static_members_table[i] TSRMLS_CC)); + zend_persist_zval_calc(&ce->default_static_members_table[i] TSRMLS_CC); } } - ADD_SIZE(zend_hash_persist_calc(&ce->constants_table, zend_persist_zval_calc TSRMLS_CC)); + zend_hash_persist_calc(&ce->constants_table, zend_persist_zval_calc TSRMLS_CC); if (ZEND_CE_FILENAME(ce)) { ADD_STRING(ZEND_CE_FILENAME(ce)); @@ -298,7 +282,7 @@ static uint zend_persist_class_entry_calc(zval *zv TSRMLS_DC) ADD_STRING(ZEND_CE_DOC_COMMENT(ce)); } - ADD_SIZE(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 TSRMLS_CC); if (ce->trait_aliases) { int i = 0; @@ -345,24 +329,32 @@ static uint zend_persist_class_entry_calc(zval *zv TSRMLS_DC) ADD_SIZE(sizeof(zend_trait_precedence*) * (i + 1)); } } - RETURN_SIZE(); } -static uint zend_accel_persist_class_table_calc(HashTable *class_table TSRMLS_DC) +static void zend_accel_persist_class_table_calc(HashTable *class_table TSRMLS_DC) { - return zend_hash_persist_calc(class_table, zend_persist_class_entry_calc TSRMLS_CC); + zend_hash_persist_calc(class_table, zend_persist_class_entry_calc TSRMLS_CC); } uint zend_accel_script_persist_calc(zend_persistent_script *new_persistent_script, char *key, unsigned int key_length TSRMLS_DC) { - START_SIZE(); + new_persistent_script->mem = NULL; + new_persistent_script->size = 0; + new_persistent_script->arena_mem = NULL; + new_persistent_script->arena_size = 0; + ZCG(current_persistent_script) = new_persistent_script; - ADD_SIZE(zend_hash_persist_calc(&new_persistent_script->function_table, zend_persist_op_array_calc TSRMLS_CC)); - ADD_SIZE(zend_accel_persist_class_table_calc(&new_persistent_script->class_table TSRMLS_CC)); - ADD_SIZE(zend_persist_op_array_calc_ex(&new_persistent_script->main_op_array TSRMLS_CC)); + ADD_DUP_SIZE(new_persistent_script, sizeof(zend_persistent_script)); ADD_DUP_SIZE(key, key_length + 1); ADD_STRING(new_persistent_script->full_path); - ADD_DUP_SIZE(new_persistent_script, sizeof(zend_persistent_script)); - RETURN_SIZE(); + 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); + + new_persistent_script->size += new_persistent_script->arena_size; + + ZCG(current_persistent_script) = NULL; + + return new_persistent_script->size; } diff --git a/ext/opcache/zend_shared_alloc.c b/ext/opcache/zend_shared_alloc.c index 981829f5b7..43a0263ee5 100644 --- a/ext/opcache/zend_shared_alloc.c +++ b/ext/opcache/zend_shared_alloc.c @@ -343,7 +343,7 @@ void *_zend_shared_memdup(void *source, size_t size, zend_bool free_source TSRML /* we already duplicated this pointer */ return old_p; } - retval = ZCG(mem);; + retval = ZCG(mem); ZCG(mem) = (void*)(((char*)ZCG(mem)) + ZEND_ALIGNED_SIZE(size)); memcpy(retval, source, size); if (free_source) { diff --git a/ext/openssl/config0.m4 b/ext/openssl/config0.m4 index a97114f808..701e488385 100644 --- a/ext/openssl/config0.m4 +++ b/ext/openssl/config0.m4 @@ -8,6 +8,9 @@ PHP_ARG_WITH(openssl, for OpenSSL support, PHP_ARG_WITH(kerberos, for Kerberos support, [ --with-kerberos[=DIR] OPENSSL: Include Kerberos support], no, no) +PHP_ARG_WITH(system-ciphers, whether to use system default cipher list instead of hardcoded value, +[ --with-system-ciphers OPENSSL: Use system default cipher list instead of hardcoded value], no, no) + if test "$PHP_OPENSSL" != "no"; then PHP_NEW_EXTENSION(openssl, openssl.c xp_ssl.c, $ext_shared) PHP_SUBST(OPENSSL_SHARED_LIBADD) @@ -25,4 +28,7 @@ if test "$PHP_OPENSSL" != "no"; then ], [ AC_MSG_ERROR([OpenSSL check failed. Please check config.log for more information.]) ]) + if test "$PHP_SYSTEM_CIPHERS" != "no"; then + AC_DEFINE(USE_OPENSSL_SYSTEM_CIPHERS,1,[ Use system default cipher list instead of hardcoded value ]) + fi fi diff --git a/ext/openssl/openssl.dsp b/ext/openssl/openssl.dsp deleted file mode 100644 index d8cd7ead40..0000000000 --- a/ext/openssl/openssl.dsp +++ /dev/null @@ -1,111 +0,0 @@ -# Microsoft Developer Studio Project File - Name="openssl" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=openssl - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "openssl.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "openssl.mak" CFG="openssl - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "openssl - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "openssl - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "openssl - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OPENSSL_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_OPENSSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_OPENSSL_EXT=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php7ts.lib ssleay32.lib libeay32.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_openssl.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "openssl - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OPENSSL_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_OPENSSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_OPENSSL_EXT=1 /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php7ts_debug.lib ssleay32.lib libeay32.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_openssl.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "openssl - Win32 Release_TS"
-# Name "openssl - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\openssl.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\xp_ssl.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_openssl.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/openssl/tests/bug65729.pem b/ext/openssl/tests/bug65729.pem index dbeed6efd3..918445712e 100644 --- a/ext/openssl/tests/bug65729.pem +++ b/ext/openssl/tests/bug65729.pem @@ -1,28 +1,32 @@ ------BEGIN CERTIFICATE----- -MIICCTCCAXICCQDNMI29sowT7TANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJT -RzESMBAGA1UECBMJVGVzdHZpbGxlMREwDwYDVQQKEwhkYXRpYmJhdzETMBEGA1UE -AxQKKi50ZXN0LmNvbTAeFw0xMzA5MjEwNzUyMjRaFw0xNDA5MjEwNzUyMjRaMEkx -CzAJBgNVBAYTAlNHMRIwEAYDVQQIEwlUZXN0dmlsbGUxETAPBgNVBAoTCGRhdGli -YmF3MRMwEQYDVQQDFAoqLnRlc3QuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB -iQKBgQCdzVnic8K5W4SVbwVuqezcTjeqVLoQ91vVNZB0Jnsuz6q3DoK03oAd1jTe -Vd0k+MQDbXpHoc37lA4+8z/g5Bs0UXxNx+nkbFTE7Ba2/G24caI9/cOXZPG3UViD -rtqXKL6h5/umqRG9Dt5liF2MVP9XFAesVC7B8+Ca+PbPlQoYzwIDAQABMA0GCSqG -SIb3DQEBBQUAA4GBAAS07u/Ke+EhEHidz6CG3Qcr+zg483JKRgZFyGz+YUKyyKKy -fmLs7JieGJxYQjOmIpj/6X9Gnb2HjIPDnI6A+MV1emXDTnnmsgf2/lZGcthhpZn2 -rMbj9bI0iH6HwOVGtp4ZJA5fB7nj3J+gWNTCQzDDOxwX36d2LL9ua+UMnk/g ------END CERTIFICATE----- -----BEGIN RSA PRIVATE KEY----- -MIICXQIBAAKBgQCdzVnic8K5W4SVbwVuqezcTjeqVLoQ91vVNZB0Jnsuz6q3DoK0 -3oAd1jTeVd0k+MQDbXpHoc37lA4+8z/g5Bs0UXxNx+nkbFTE7Ba2/G24caI9/cOX -ZPG3UViDrtqXKL6h5/umqRG9Dt5liF2MVP9XFAesVC7B8+Ca+PbPlQoYzwIDAQAB -AoGAeyzTwKPDl5QMRejHQL57GOwlH1vLcXrjv+VzwHZZKQ0IoKM++5fCQYf29KXp -XPahaluGW2u9sWa8R/7wGcd0Q4RtquGzsgT3+AQsIc5KfIamyOyDaRVM/ymX3fWg -gHIU7OOzB+ihOU8sHyRIwfbk01/kmrBXLRj8E31sy3i3PIECQQDQQYE+aN7Acrdt -yN5CaqvbkiCGjRvASlemiTzPosgOtndyp21w1gakJwKYhYDk1N6A6Qb8REMZqM/U -wFypldV/AkEAwfq6NFuhpGL6hDA7MvlyY1KiZ0cHetPUX+PgdNqy2DA+1Sv4i7gm -Wd/uA651K7aPXuUaf9dKtPCmZwI4M6SEsQJBALW89HTqP7niYoDEEnITdPaghxHk -gptERUln6lGo1L1CLus3gSI/JHyMLo+7scgAnEwTD62GRKhX0Ubwt+ymfTECQAY5 -fHYnppU20+EgBxZIqOIFCc8UmWnYmE0Ha/Fz/x8u1SVUBuK84wYpSGL32yyu7ATY -hzQo/W229zABAzqtAdECQQCUdB7IBFpPnsfv/EUBFX7X/7zAc9JpACmu9It5ju8C -KIsMuz/02D+TQoJNjdAngBM+4AJDIaGFgTMIfaDMh5L7 +MIICXgIBAAKBgQDU8RgB8O2uR3ApjlxEX5rpCI+gIaZ3h0RBAF9rNA/s0pPTtX/e +NGJgDyuT/TF6mcv0I/0/s2WSmIE50NW6tgWZ7RoBdVw/MiByPt6vK1aDrggbycN/ +C6RrxrEsdZe3E9CDZCFM1br8/8tnV19Ju80g8zY2MgDjAjSkeXN5yp3kgQIDAQAB +AoGBANFKKRt3TlRVmHLvndYB1YKmzGtJx5CBXV85247FO8W67lpNcGDYQbxCDMXG +PARQ9vl9CeK7EuDzjUdi7z40uujUOJtsLbMP6ikwKFi/tA2cW1yoLionZ3JkfyEr +4Uu8kkkIut0VLX8uuVz/Y03lt8Uzc+GvD2DPhkSQn80f10SFAkEA94EcjwFcwuVi +QofgOPbf7qfOoWDsXYhlMU9g1CaPJiMcMcvgoLK3V514oMDxlkvuLujlYeG9NvRS +tREluGsbywJBANxARX5MSzAkFRNZNZKDUvifdC0BA2Dqzd2iOJRcTdcebGENd7+e +oub/9lVLGrX7T4U2en8IXwJV4UHxwoQLz2MCQQCI1Bj8ui0VFgj/bOy5sUnVP3IN +Z27kuo3u98o5HuQOmmRw5xxU2thfGJBilqg4hdu0lU6SkWCwq9u5fDRVQumHAkAM +mJBg3LQgGLAr3xo1OtVv6o6WVEyBKmyDlFdwBKde+hpwoniKuOPQGitYTWdFqQ2v +LKJsyWnFlGvBfbYGHzbJAkEA17SgCf7Wx7NxuLCSMj/rd25ul0jlIrjx6+/HfyLb ++T2SXXU4g2DBiPngrfJ9jX8QGoLpZiBGcwX3QxssX5FgJQ== -----END RSA PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIICvDCCAiWgAwIBAgIJANOyJnvPEioVMA0GCSqGSIb3DQEBBQUAMEkxCzAJBgNV +BAYTAlNHMRIwEAYDVQQIEwlUZXN0dmlsbGUxETAPBgNVBAoTCGRhdGliYmF3MRMw +EQYDVQQDFAoqLnRlc3QuY29tMB4XDTE0MTAxNTEzMDg1OFoXDTM0MTAxMDEzMDg1 +OFowSTELMAkGA1UEBhMCU0cxEjAQBgNVBAgTCVRlc3R2aWxsZTERMA8GA1UEChMI +ZGF0aWJiYXcxEzARBgNVBAMUCioudGVzdC5jb20wgZ8wDQYJKoZIhvcNAQEBBQAD +gY0AMIGJAoGBANTxGAHw7a5HcCmOXERfmukIj6AhpneHREEAX2s0D+zSk9O1f940 +YmAPK5P9MXqZy/Qj/T+zZZKYgTnQ1bq2BZntGgF1XD8yIHI+3q8rVoOuCBvJw38L +pGvGsSx1l7cT0INkIUzVuvz/y2dXX0m7zSDzNjYyAOMCNKR5c3nKneSBAgMBAAGj +gaswgagwHQYDVR0OBBYEFErHO0eHLp9YvBWVvvhty/jGie5wMHkGA1UdIwRyMHCA +FErHO0eHLp9YvBWVvvhty/jGie5woU2kSzBJMQswCQYDVQQGEwJTRzESMBAGA1UE +CBMJVGVzdHZpbGxlMREwDwYDVQQKEwhkYXRpYmJhdzETMBEGA1UEAxQKKi50ZXN0 +LmNvbYIJANOyJnvPEioVMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEA +gMv2HUUp0FMTYQ6tL9YgNUNARukxJzGDWweo4/YuNSgI+Ljpye4Nf1MpyDWfhZGc +QbUhfm5CdEvcBzZBtI0lLXs61yGdLnDH/6QHViXP2rlH0yeAABw8+wSdxuiZN1yR +ed4pNXU+tczgW2Ri2+T0ScOZd0XommKHrQnu2T9mMBY= +-----END CERTIFICATE----- diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index b3213f9aea..df2b6dd58e 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -1453,13 +1453,16 @@ int php_openssl_setup_crypto(php_stream *stream, } GET_VER_OPT_STRING("ciphers", cipherlist); +#ifndef USE_OPENSSL_SYSTEM_CIPHERS if (!cipherlist) { cipherlist = OPENSSL_DEFAULT_STREAM_CIPHERS; } - if (SSL_CTX_set_cipher_list(sslsock->ctx, cipherlist) != 1) { - return FAILURE; +#endif + if (cipherlist) { + if (SSL_CTX_set_cipher_list(sslsock->ctx, cipherlist) != 1) { + return FAILURE; + } } - if (FAILURE == set_local_cert(sslsock->ctx, stream TSRMLS_CC)) { return FAILURE; } @@ -1775,59 +1778,13 @@ static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size } /* }}} */ -static void php_openssl_stream_wait_for_data(php_netstream_data_t *sock) -{ - int retval; - struct timeval *ptimeout; - - if (sock->socket == -1) { - return; - } - - sock->timeout_event = 0; - - if (sock->timeout.tv_sec == -1) - ptimeout = NULL; - else - ptimeout = &sock->timeout; - - while(1) { - retval = php_pollfd_for(sock->socket, PHP_POLLREADABLE, ptimeout); - - if (retval == 0) - sock->timeout_event = 1; - - if (retval >= 0) - break; - - if (php_socket_errno() != EINTR) - break; - } -} - static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */ { php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract; - php_netstream_data_t *sock; int nr_bytes = 0; if (sslsock->ssl_active) { int retry = 1; - sock = (php_netstream_data_t*)stream->abstract; - - /* The SSL_read() function will block indefinitely waiting for data on a blocking - socket. If we don't poll for readability first this operation has the potential - to hang forever. To avoid this scenario we poll with a timeout before performing - the actual read. If it times out we're finished. - */ - if (sock->is_blocked && SSL_pending(sslsock->ssl_handle) == 0) { - php_openssl_stream_wait_for_data(sock); - if (sock->timeout_event) { - stream->eof = 1; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL read operation timed out"); - return nr_bytes; - } - } do { nr_bytes = SSL_read(sslsock->ssl_handle, buf, count); @@ -2146,21 +2103,6 @@ static int php_openssl_sockop_cast(php_stream *stream, int castas, void **ret TS case PHP_STREAM_AS_FD_FOR_SELECT: if (ret) { - /* OpenSSL has an internal buffer which select() cannot see. If we don't - * fetch it into the stream's buffer, no activity will be reported on the - * stream even though there is data waiting to be read - but we only fetch - * the lower of bytes OpenSSL has ready to give us or chunk_size since we - * weren't asked for any data at this stage. This is only likely to cause - * issues with non-blocking streams, but it's harmless to always do it. */ - size_t pending; - if (stream->writepos == stream->readpos - && sslsock->ssl_active - && (pending = (size_t)SSL_pending(sslsock->ssl_handle)) > 0) { - php_stream_fill_read_buffer(stream, pending < stream->chunk_size - ? pending - : stream->chunk_size); - } - *(php_socket_t *)ret = sslsock->s.socket; } return SUCCESS; diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 67857da2c7..918214edb1 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -423,8 +423,8 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS extra = pcre_study(re, soptions, &error); if (extra) { extra->flags |= PCRE_EXTRA_MATCH_LIMIT | PCRE_EXTRA_MATCH_LIMIT_RECURSION; - extra->match_limit = PCRE_G(backtrack_limit); - extra->match_limit_recursion = PCRE_G(recursion_limit); + extra->match_limit = (unsigned long)PCRE_G(backtrack_limit); + 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"); @@ -568,14 +568,14 @@ static void php_do_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global) /* {{{ * RETURN_FALSE; } - php_pcre_match_impl(pce, subject->val, subject->len, return_value, subpats, + php_pcre_match_impl(pce, subject->val, (int)subject->len, return_value, subpats, global, ZEND_NUM_ARGS() >= 4, flags, start_offset TSRMLS_CC); } /* }}} */ /* {{{ 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, long flags, long start_offset TSRMLS_DC) + zval *subpats, int global, int use_flags, zend_long flags, zend_long start_offset TSRMLS_DC) { zval result_set, /* Holds a set of subpatterns after a global match */ @@ -640,8 +640,8 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec extra_data.flags = PCRE_EXTRA_MATCH_LIMIT | PCRE_EXTRA_MATCH_LIMIT_RECURSION; extra = &extra_data; } - extra->match_limit = PCRE_G(backtrack_limit); - extra->match_limit_recursion = PCRE_G(recursion_limit); + extra->match_limit = (unsigned long)PCRE_G(backtrack_limit); + extra->match_limit_recursion = (unsigned long)PCRE_G(recursion_limit); #ifdef PCRE_EXTRA_MARK extra->mark = &mark; extra->flags |= PCRE_EXTRA_MARK; @@ -682,7 +682,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec do { /* Execute the regular expression. */ - count = pcre_exec(pce->re, extra, subject, subject_len, start_offset, + count = pcre_exec(pce->re, extra, subject, (int)subject_len, (int)start_offset, exoptions|g_notempty, offsets, size_offsets); /* the string was already proved to be valid UTF-8 */ @@ -834,8 +834,8 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec the start offset, and continue. Fudge the offset values to achieve this, unless we're already at the end of the string. */ if (g_notempty != 0 && start_offset < subject_len) { - offsets[0] = start_offset; - offsets[1] = start_offset + 1; + offsets[0] = (int)start_offset; + offsets[1] = (int)(start_offset + 1); } else break; } else { @@ -1130,8 +1130,8 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject, extra_data.flags = PCRE_EXTRA_MATCH_LIMIT | PCRE_EXTRA_MATCH_LIMIT_RECURSION; extra = &extra_data; } - extra->match_limit = PCRE_G(backtrack_limit); - extra->match_limit_recursion = PCRE_G(recursion_limit); + extra->match_limit = (unsigned long)PCRE_G(backtrack_limit); + extra->match_limit_recursion = (unsigned long)PCRE_G(recursion_limit); eval = pce->preg_options & PREG_REPLACE_EVAL; if (is_callable_replace) { @@ -1141,7 +1141,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject, } } else { replace = Z_STRVAL_P(replace_val); - replace_len = Z_STRLEN_P(replace_val); + replace_len = (int)Z_STRLEN_P(replace_val); replace_end = replace + replace_len; } @@ -1212,11 +1212,11 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject, if (eval) { eval_result = preg_do_eval(replace, replace_len, subject, offsets, count TSRMLS_CC); - new_len += eval_result->len; + 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); - new_len += eval_result->len; + new_len += (int)eval_result->len; } else { /* do regular substitution */ walk = replace; walk_last = 0; @@ -1245,7 +1245,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject, } /* copy the part of the string before the match */ memcpy(&result->val[result_len], piece, match-piece); - result_len += match-piece; + result_len += (int)(match-piece); /* copy replacement and backrefs */ walkbuf = result->val + result_len; @@ -1254,7 +1254,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject, * and clean up. */ if (eval || is_callable_replace) { memcpy(walkbuf, eval_result->val, eval_result->len); - result_len += eval_result->len; + result_len += (int)eval_result->len; if (eval_result) zend_string_release(eval_result); } else { /* do regular backreference copying */ walk = replace; @@ -1280,7 +1280,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject, } *walkbuf = '\0'; /* increment the result length by how much we've added to the string */ - result_len += walkbuf - (result->val + result_len); + result_len += (int)(walkbuf - (result->val + result_len)); } if (limit != -1) @@ -1393,7 +1393,7 @@ static zend_string *php_replace_in_subject(zval *regex, zval *replace, zval *sub for further replacements. */ if ((result = php_pcre_replace(regex_str, subject_str->val, - subject_str->len, + (int)subject_str->len, replace_value, is_callable_replace, limit, @@ -1413,7 +1413,7 @@ static zend_string *php_replace_in_subject(zval *regex, zval *replace, zval *sub } else { result = php_pcre_replace(Z_STR_P(regex), subject_str->val, - subject_str->len, + (int)subject_str->len, replace, is_callable_replace, limit, @@ -1477,7 +1477,7 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, int is_callable_repl } if (ZEND_NUM_ARGS() > 3) { - limit_val = limit; + limit_val = (int)limit; } if (Z_TYPE_P(regex) != IS_ARRAY) { @@ -1579,14 +1579,14 @@ static PHP_FUNCTION(preg_split) RETURN_FALSE; } - php_pcre_split_impl(pce, subject->val, subject->len, return_value, limit_val, flags TSRMLS_CC); + php_pcre_split_impl(pce, subject->val, (int)subject->len, return_value, (int)limit_val, flags TSRMLS_CC); } /* }}} */ /* {{{ php_pcre_split */ PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value, - long limit_val, long flags TSRMLS_DC) + zend_long limit_val, zend_long flags TSRMLS_DC) { pcre_extra *extra = NULL; /* Holds results of studying */ pcre *re_bump = NULL; /* Regex instance for empty matches */ @@ -1617,8 +1617,8 @@ PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subjec extra_data.flags = PCRE_EXTRA_MATCH_LIMIT | PCRE_EXTRA_MATCH_LIMIT_RECURSION; extra = &extra_data; } - extra->match_limit = PCRE_G(backtrack_limit); - extra->match_limit_recursion = PCRE_G(recursion_limit); + extra->match_limit = (unsigned long)PCRE_G(backtrack_limit); + extra->match_limit_recursion = (unsigned long)PCRE_G(recursion_limit); #ifdef PCRE_EXTRA_MARK extra->flags &= ~PCRE_EXTRA_MARK; #endif @@ -1661,7 +1661,7 @@ PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subjec if (offset_capture) { /* Add (match, offset) pair to the return value */ - add_offset_pair(return_value, last_match, &subject[offsets[0]]-last_match, next_offset, NULL); + add_offset_pair(return_value, last_match, (int)(&subject[offsets[0]]-last_match), next_offset, NULL); } else { /* Add the piece to the return value */ add_next_index_stringl(return_value, last_match, @@ -1737,7 +1737,7 @@ PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subjec } - start_offset = last_match - subject; /* the offset might have been incremented, but without further successful matches */ + start_offset = (int)(last_match - subject); /* the offset might have been incremented, but without further successful matches */ if (!no_empty || start_offset < subject_len) { @@ -1889,7 +1889,7 @@ static PHP_FUNCTION(preg_grep) } /* }}} */ -PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return_value, long flags TSRMLS_DC) /* {{{ */ +PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return_value, zend_long flags TSRMLS_DC) /* {{{ */ { zval *entry; /* An entry in the input array */ pcre_extra *extra = pce->extra;/* Holds results of studying */ @@ -1909,8 +1909,8 @@ PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return extra_data.flags = PCRE_EXTRA_MATCH_LIMIT | PCRE_EXTRA_MATCH_LIMIT_RECURSION; extra = &extra_data; } - extra->match_limit = PCRE_G(backtrack_limit); - extra->match_limit_recursion = PCRE_G(recursion_limit); + extra->match_limit = (unsigned long)PCRE_G(backtrack_limit); + extra->match_limit_recursion = (unsigned long)PCRE_G(recursion_limit); #ifdef PCRE_EXTRA_MARK extra->flags &= ~PCRE_EXTRA_MARK; #endif @@ -1934,7 +1934,7 @@ PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return /* Perform the match */ count = pcre_exec(pce->re, extra, subject_str->val, - subject_str->len, 0, + (int)subject_str->len, 0, 0, offsets, size_offsets); /* Check for too many substrings condition. */ diff --git a/ext/pcre/php_pcre.h b/ext/pcre/php_pcre.h index cd6621372f..a8523cff9c 100644 --- a/ext/pcre/php_pcre.h +++ b/ext/pcre/php_pcre.h @@ -57,21 +57,21 @@ typedef struct { PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS_DC); 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, long flags, long start_offset TSRMLS_DC); + zval *subpats, int global, int use_flags, zend_long flags, zend_long start_offset TSRMLS_DC); 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); PHPAPI void php_pcre_split_impl( pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value, - long limit_val, long flags TSRMLS_DC); + zend_long limit_val, zend_long flags TSRMLS_DC); PHPAPI void php_pcre_grep_impl( pcre_cache_entry *pce, zval *input, zval *return_value, - long flags TSRMLS_DC); + zend_long flags TSRMLS_DC); ZEND_BEGIN_MODULE_GLOBALS(pcre) HashTable pcre_cache; - long backtrack_limit; - long recursion_limit; + zend_long backtrack_limit; + zend_long recursion_limit; #ifdef PCRE_STUDY_JIT_COMPILE zend_bool jit; #endif diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index 2abd5a03ef..aca52ebf20 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -425,7 +425,7 @@ static zval *pdo_stmt_instantiate(pdo_dbh_t *dbh, zval *object, zend_class_entry return object; } /* }}} */ -static void pdo_stmt_construct(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 TSRMLS_DC) /* {{{ */ { zval query_string; zval z_key; @@ -556,7 +556,7 @@ static PHP_METHOD(PDO, prepare) ZVAL_UNDEF(&stmt->lazy_object_ref); if (dbh->methods->preparer(dbh, statement, statement_len, stmt, options TSRMLS_CC)) { - pdo_stmt_construct(stmt, return_value, dbstmt_ce, &ctor_args TSRMLS_CC); + pdo_stmt_construct(execute_data, stmt, return_value, dbstmt_ce, &ctor_args TSRMLS_CC); return; } @@ -1109,7 +1109,7 @@ static PHP_METHOD(PDO, query) stmt->executed = 1; } if (ret) { - pdo_stmt_construct(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 TSRMLS_CC); return; } } diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 5781de78e6..705d08bacf 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -978,7 +978,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_ ZVAL_COPY(return_value, &stmt->fetch.into); - if (zend_get_class_entry(Z_OBJ_P(return_value) TSRMLS_CC) == ZEND_STANDARD_CLASS_DEF_PTR) { + if (Z_OBJ_P(return_value)->ce == ZEND_STANDARD_CLASS_DEF_PTR) { how = PDO_FETCH_OBJ; } break; @@ -2636,18 +2636,9 @@ static union _zend_function *row_get_ctor(zend_object *object TSRMLS_DC) return (union _zend_function*)&ctor; } -static zend_class_entry *row_get_ce(const zend_object *object TSRMLS_DC) +static zend_string *row_get_classname(const zend_object *object TSRMLS_DC) { - return pdo_row_ce; -} - -static zend_string *row_get_classname(const zend_object *object, int parent TSRMLS_DC) -{ - if (parent) { - return NULL; - } else { - return zend_string_init("PDORow", sizeof("PDORow") - 1, 0); - } + return zend_string_init("PDORow", sizeof("PDORow") - 1, 0); } static int row_compare(zval *object1, zval *object2 TSRMLS_DC) @@ -2675,7 +2666,6 @@ zend_object_handlers pdo_row_object_handlers = { row_method_get, row_call_method, row_get_ctor, - row_get_ce, row_get_classname, row_compare, NULL, /* cast */ diff --git a/ext/pdo_dblib/README b/ext/pdo_dblib/README index 888ffb676f..15f8d147a0 100644 --- a/ext/pdo_dblib/README +++ b/ext/pdo_dblib/README @@ -1,25 +1,12 @@ This is the unified Sybase-DB style driver for PDO. -There are three implementations of this library that are known to me: - -- The Sybase DB lib itself -- MSSQL DB lib -- FreeTDS DB lib - -This extension will compile and register itself as 'mssql' when built against -the mssql libraries (and be named php_pdo_mssql.dll), or 'sybase' otherwise -(php_pdo_sybase.dll) - -If you want to try out the free "desktop" version of SQL Server, known as the MSDE, google to obtain the appropriate download link. Here are some short tips on getting it running: - -- Download it and run it to extract it -- Open up a command prompt -- cd \MSDERelA -- setup.exe SQLSECURITY=1 SAPWD=yoursecretpassword -- cd \Program Files\Microsoft SQL Server\80\Tools\Binn -- SVRNETCN.exe -- enable TCP (you MUST do this if you want to access it via FreeTDS/Sybase libs) -- net start mssqlserver - -Consult the MS docs for more information about all this stuff. +This extension register itself as: + - 'mssql' when built against the Microsoft DBLIB library + - 'sybase' when built against Sybase ct-lib + - 'dblib' when built against FreeTDS +The following database products are free for testing: + - Microsoft SQL Server Express (Windows Only) + - Sybase Adaptive Server (Windows, Linux, *NIX) + - Microsoft SQL Server Azure (One Month Trial Cloud Service) + diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c index 40d4114879..a433e8652c 100644 --- a/ext/pdo_dblib/dblib_driver.c +++ b/ext/pdo_dblib/dblib_driver.c @@ -61,7 +61,6 @@ static int dblib_fetch_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS msg, einfo->dberr, einfo->severity, stmt ? stmt->active_query_string : ""); add_next_index_long(info, einfo->dberr); - // TODO: avoid reallocation ??? add_next_index_string(info, message); efree(message); add_next_index_long(info, einfo->oserr); @@ -145,28 +144,58 @@ static zend_long dblib_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sq 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) { - pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data; - char *q; - int l = 1; - - *quoted = q = safe_emalloc(2, unquotedlen, 3); - *q++ = '\''; - - while (unquotedlen--) { - if (*unquoted == '\'') { - *q++ = '\''; - *q++ = '\''; - l += 2; - } else { - *q++ = *unquoted; - ++l; + + int useBinaryEncoding = 0; + const char * hex = "0123456789abcdef"; + int i; + char * q; + *quotedlen = 0; + + /* + * Detect quoted length and if we should use binary encoding + */ + for(i=0;i<unquotedlen;i++) { + if( 32 > unquoted[i] || 127 < unquoted[i] ) { + useBinaryEncoding = 1; + break; + } + if(unquoted[i] == '\'') ++*quotedlen; + ++*quotedlen; + } + + if(useBinaryEncoding) { + /* + * Binary safe quoting + * Will implicitly convert for all data types except Text, DateTime & SmallDateTime + * + */ + *quotedlen = (unquotedlen * 2) + 2; /* 2 chars per byte +2 for "0x" prefix */ + q = *quoted = emalloc(*quotedlen); + + *q++ = '0'; + *q++ = 'x'; + for (i=0;i<unquotedlen;i++) { + *q++ = hex[ (*unquoted>>4)&0xF]; + *q++ = hex[ (*unquoted++)&0xF]; + } + } else { + /* Alpha/Numeric Quoting */ + *quotedlen += 2; /* +2 for opening, closing quotes */ + q = *quoted = emalloc(*quotedlen); + *q++ = '\''; + + for (i=0;i<unquotedlen;i++) { + if (unquoted[i] == '\'') { + *q++ = '\''; + *q++ = '\''; + } else { + *q++ = unquoted[i]; + } } - unquoted++; + *q++ = '\''; } - *q++ = '\''; - *q++ = '\0'; - *quotedlen = l+1; + *q = 0; return 1; } @@ -174,7 +203,6 @@ static int dblib_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquote static int pdo_dblib_transaction_cmd(const char *cmd, pdo_dbh_t *dbh TSRMLS_DC) { pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data; - RETCODE ret; if (FAIL == dbcmd(H->link, cmd)) { return 0; @@ -240,12 +268,29 @@ char *dblib_handle_last_id(pdo_dbh_t *dbh, const char *name, unsigned int *len T } id = emalloc(32); - *len = dbconvert(NULL, (dbcoltype(H->link, 1)) , (dbdata(H->link, 1)) , (dbdatlen(H->link, 1)), SQLCHAR, id, (DBINT)-1); + *len = dbconvert(NULL, (dbcoltype(H->link, 1)) , (dbdata(H->link, 1)) , (dbdatlen(H->link, 1)), SQLCHAR, (BYTE *)id, (DBINT)-1); dbcancel(H->link); return id; } +static int dblib_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC) +{ + switch(attr) { + case PDO_ATTR_TIMEOUT: + return 0; + default: + return 1; + } + +} + +static int dblib_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_value TSRMLS_DC) +{ + /* dblib_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; */ + return 0; +} + static struct pdo_dbh_methods dblib_methods = { dblib_handle_closer, dblib_handle_preparer, @@ -254,10 +299,10 @@ static struct pdo_dbh_methods dblib_methods = { dblib_handle_begin, /* begin */ dblib_handle_commit, /* commit */ dblib_handle_rollback, /* rollback */ - NULL, /*set attr */ + dblib_set_attr, /*set attr */ dblib_handle_last_id, /* last insert id */ dblib_fetch_error, /* fetch error */ - NULL, /* get attr */ + dblib_get_attribute, /* get attr */ NULL, /* check liveness */ NULL, /* get driver methods */ NULL, /* request shutdown */ @@ -268,7 +313,6 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_ { pdo_dblib_db_handle *H; int i, nvars, nvers, ret = 0; - int *val; const pdo_dblib_keyval tdsver[] = { {"4.2",DBVERSION_42} @@ -303,6 +347,12 @@ 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); + dbsetlogintime(timeout); /* Connection/Login Timeout */ + dbsettime(timeout); /* Statement Timeout */ + } + H = pecalloc(1, sizeof(*H), dbh->is_persistent); H->login = dblogin(); H->err.sqlstate = dbh->error_code; @@ -311,8 +361,8 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_ goto cleanup; } - DBERRHANDLE(H->login, (EHANDLEFUNC) error_handler); - DBMSGHANDLE(H->login, (MHANDLEFUNC) msg_handler); + DBERRHANDLE(H->login, (EHANDLEFUNC) pdo_dblib_error_handler); + DBMSGHANDLE(H->login, (MHANDLEFUNC) pdo_dblib_msg_handler); if(vars[5].optval) { for(i=0;i<nvers;i++) { diff --git a/ext/pdo_dblib/dblib_stmt.c b/ext/pdo_dblib/dblib_stmt.c index a29405b24e..bd79be3e9c 100644 --- a/ext/pdo_dblib/dblib_stmt.c +++ b/ext/pdo_dblib/dblib_stmt.c @@ -103,21 +103,15 @@ static int pdo_dblib_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC) /* Cancel any pending results */ dbcancel(H->link); - efree(stmt->columns); - stmt->columns = NULL; - return 1; } static int pdo_dblib_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) { pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data; - - efree(stmt->columns); - stmt->columns = NULL; - + efree(S); - + return 1; } @@ -128,16 +122,16 @@ static int pdo_dblib_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) RETCODE ret; ret = dbresults(H->link); - + if (FAIL == ret) { pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO_DBLIB: dbresults() returned FAIL" TSRMLS_CC); return 0; } - + if(NO_MORE_RESULTS == ret) { return 0; } - + stmt->row_count = DBCOUNT(H->link); stmt->column_count = dbnumcols(H->link); @@ -204,7 +198,7 @@ static int pdo_dblib_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) struct pdo_column_data *col = &stmt->columns[colno]; - col->name = (char*)dbcolname(H->link, colno+1); + col->name = estrdup(dbcolname(H->link, colno+1)); col->maxlen = dbcollen(H->link, colno+1); col->namelen = strlen(col->name); col->param_type = PDO_PARAM_STR; @@ -255,12 +249,11 @@ static int pdo_dblib_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, break; } case SQLUNIQUE: { - *len = 36+1; + *len = 37; tmp_ptr = emalloc(*len + 1); - - /* uniqueidentifier is a 16-byte binary number, convert to 32 char hex string */ *len = dbconvert(NULL, SQLUNIQUE, *ptr, *len, SQLCHAR, tmp_ptr, *len); php_strtoupper(tmp_ptr, *len); + tmp_ptr[36] = '\0'; *ptr = tmp_ptr; break; } diff --git a/ext/pdo_dblib/pdo_dblib.c b/ext/pdo_dblib/pdo_dblib.c index 3afd885df5..4cd0749cf8 100644 --- a/ext/pdo_dblib/pdo_dblib.c +++ b/ext/pdo_dblib/pdo_dblib.c @@ -86,7 +86,7 @@ ZEND_GET_MODULE(pdo_dblib) #endif #endif -int error_handler(DBPROCESS *dbproc, int severity, int dberr, +int pdo_dblib_error_handler(DBPROCESS *dbproc, int severity, int dberr, int oserr, char *dberrstr, char *oserrstr) { pdo_dblib_err *einfo; @@ -103,6 +103,7 @@ int error_handler(DBPROCESS *dbproc, int severity, int dberr, einfo->severity = severity; einfo->oserr = oserr; einfo->dberr = dberr; + if (einfo->oserrstr) { efree(einfo->oserrstr); } @@ -128,16 +129,10 @@ int error_handler(DBPROCESS *dbproc, int severity, int dberr, } strcpy(einfo->sqlstate, state); -#if 0 - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "dblib error: %d %s (severity %d)", - dberr, dberrstr, severity); -#endif - return INT_CANCEL; } -int msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate, +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; @@ -156,10 +151,6 @@ int msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate, einfo->lastmsg = estrdup(msgtext); } -#if 0 - php_error_docref(NULL TSRMLS_CC, E_WARNING, "dblib message: %s (severity %d)", msgtext, severity); -#endif - return 0; } @@ -196,18 +187,9 @@ PHP_MINIT_FUNCTION(pdo_dblib) return FAILURE; } - /* TODO: - - dbsetifile() - dbsetmaxprocs() - dbsetlogintime() - dbsettime() - - */ - #if !PHP_DBLIB_IS_MSSQL - dberrhandle(error_handler); - dbmsghandle(msg_handler); + dberrhandle((EHANDLEFUNC) pdo_dblib_error_handler); + dbmsghandle((MHANDLEFUNC) pdo_dblib_msg_handler); #endif return SUCCESS; diff --git a/ext/pdo_dblib/php_pdo_dblib_int.h b/ext/pdo_dblib/php_pdo_dblib_int.h index e247b5c19e..3b341478d7 100644 --- a/ext/pdo_dblib/php_pdo_dblib_int.h +++ b/ext/pdo_dblib/php_pdo_dblib_int.h @@ -37,7 +37,7 @@ # define DBSETOPT(a, b, c) dbsetopt(a, b, c) # define SYBESMSG SQLESMSG # define SYBESEOF SQLESEOF -# define SYBEFCON SQLECONN // SQLEFCON does not exist in MS SQL Server. +# define SYBEFCON SQLECONN /* SQLEFCON does not exist in MS SQL Server. */ # define SYBEMEM SQLEMEM # define SYBEPWD SQLEPWD @@ -89,10 +89,10 @@ typedef unsigned char *LPBYTE; typedef float DBFLT4; #endif -int error_handler(DBPROCESS *dbproc, int severity, int dberr, +int pdo_dblib_error_handler(DBPROCESS *dbproc, int severity, int dberr, int oserr, char *dberrstr, char *oserrstr); -int msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate, +int pdo_dblib_msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate, int severity, char *msgtext, char *srvname, char *procname, DBUSMALLINT line); extern pdo_driver_t pdo_dblib_driver; diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_clear_error.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_clear_error.phpt index 224684b878..0beca905cd 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_clear_error.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_clear_error.phpt @@ -93,4 +93,4 @@ array(1) { Warning: PDO::prepare(): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'unknown_column' in 'field list' in %s on line %d -Fatal error: Call to a member function execute() on boolean in %s on line %d +Catchable fatal error: Call to a member function execute() on boolean in %s on line %d diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_mixed_style.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_mixed_style.phpt index b7b0ab6294..fc5554722f 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_mixed_style.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_mixed_style.phpt @@ -36,4 +36,4 @@ Warning: PDO::prepare(): SQLSTATE[HY093]: Invalid parameter number: mixed named Warning: PDO::prepare(): SQLSTATE[HY093]: Invalid parameter number in %s on line %d -Fatal error: Call to a member function execute() on boolean in %s on line %d +Catchable fatal error: Call to a member function execute() on boolean in %s on line %d diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt index c16ce5dd1c..36295e9c5e 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_errorcode.phpt @@ -56,4 +56,4 @@ Testing native PS... Warning: PDO::prepare(): SQLSTATE[42S02]: Base table or view not found: 1146 Table '%s.ihopeitdoesnotexist' doesn't exist in %s on line %d -Fatal error: Call to a member function execute() on boolean in %s on line %d +Catchable fatal error: Call to a member function execute() on boolean in %s on line %d diff --git a/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt b/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt index 52ecc912d4..278cd4e7f8 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt @@ -99,4 +99,4 @@ Native Prepared Statements... Warning: PDO::query(): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near '%SSELECT label FROM test ORDER BY id ASC LIMIT 1' at line %d in %s on line %d -Fatal error: Call to a member function errorInfo() on boolean in %s on line %d +Catchable fatal error: Call to a member function errorInfo() on boolean in %s on line %d
\ No newline at end of file diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index 327d70218b..2d45152ad9 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -471,6 +471,15 @@ static int pdo_pgsql_check_liveness(pdo_dbh_t *dbh TSRMLS_DC) } /* }}} */ +static int pgsql_handle_in_transaction(pdo_dbh_t *dbh TSRMLS_DC) +{ + pdo_pgsql_db_handle *H; + + H = (pdo_pgsql_db_handle *)dbh->driver_data; + + return PQtransactionStatus(H->server) > PQTRANS_IDLE; +} + static int pdo_pgsql_transaction_cmd(const char *cmd, pdo_dbh_t *dbh TSRMLS_DC) { pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; @@ -495,7 +504,15 @@ static int pgsql_handle_begin(pdo_dbh_t *dbh TSRMLS_DC) static int pgsql_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) { - return pdo_pgsql_transaction_cmd("COMMIT", dbh TSRMLS_CC); + int ret = pdo_pgsql_transaction_cmd("COMMIT", dbh TSRMLS_CC); + + /* 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); + } + + return ret; } static int pgsql_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) @@ -503,15 +520,6 @@ static int pgsql_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) return pdo_pgsql_transaction_cmd("ROLLBACK", dbh TSRMLS_CC); } -static int pgsql_handle_in_transaction(pdo_dbh_t *dbh TSRMLS_DC) -{ - pdo_pgsql_db_handle *H; - - H = (pdo_pgsql_db_handle *)dbh->driver_data; - - return PQtransactionStatus(H->server); -} - /* {{{ proto string PDO::pgsqlCopyFromArray(string $table_name , array $rows [, string $delimiter [, string $null_as ] [, string $fields]) Returns true if the copy worked fine or false if error */ static PHP_METHOD(PDO, pgsqlCopyFromArray) @@ -1061,10 +1069,16 @@ static PHP_METHOD(PDO, pgsqlGetNotify) if (result_type == PDO_FETCH_NUM || result_type == PDO_FETCH_BOTH) { add_index_string(return_value, 0, pgsql_notify->relname); add_index_long(return_value, 1, pgsql_notify->be_pid); + if (pgsql_notify->extra && pgsql_notify->extra[0]) { + add_index_string(return_value, 2, pgsql_notify->extra); + } } if (result_type == PDO_FETCH_ASSOC || result_type == PDO_FETCH_BOTH) { add_assoc_string(return_value, "message", pgsql_notify->relname); add_assoc_long(return_value, "pid", pgsql_notify->be_pid); + if (pgsql_notify->extra && pgsql_notify->extra[0]) { + add_assoc_string(return_value, "payload", pgsql_notify->extra); + } } PQfreemem(pgsql_notify); diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index 05b8f79b27..9e8fc746fa 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -301,7 +301,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data * if (param->paramno >= 0) { zval *parameter; - if (param->paramno > zend_hash_num_elements(stmt->bound_param_map)) { + if (param->paramno >= zend_hash_num_elements(stmt->bound_param_map)) { pdo_pgsql_error_stmt(stmt, PGRES_FATAL_ERROR, "HY105"); return 0; } diff --git a/ext/pdo_pgsql/tests/bug66584.phpt b/ext/pdo_pgsql/tests/bug66584.phpt new file mode 100644 index 0000000000..07742bca79 --- /dev/null +++ b/ext/pdo_pgsql/tests/bug66584.phpt @@ -0,0 +1,66 @@ +--TEST-- +PDO PgSQL Bug #66584 (Segmentation fault on statement deallocation) +--SKIPIF-- +<?php +if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded'); +require dirname(__FILE__) . '/config.inc'; +require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; +PDOTest::skip(); +?> +--FILE-- +<?php +require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; +$pdo = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); + +$pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); + +$pdo->beginTransaction(); + +$pdo->query("CREATE TABLE b66584 (a int)"); +$pdo->query("INSERT INTO b66584 VALUES (165)"); + +for ($i = 1; $i >= 0; $i--) { + $pdo->setAttribute(\PDO::ATTR_EMULATE_PREPARES, (bool)$i); + + try { + run($pdo, [0 => 1, 2 => 165, 5 => 3]); + } catch (\Exception $e) { + var_dump($e->getMessage()); + } + + try { + run($pdo, json_decode('{"0":234,"1":165,"2":221,"3":207,"4":188,"5":216,"6":1150,"7":916,"8":967,"9":987,"10":951,"11":990,"12":959,"13":896,"14":947,"15":877,"16":1000,"17":1023,"18":904,"19":856,"20":860,"21":866,"22":930,"23":974,"24":1032,"25":1016,"26":1050,"27":1059,"28":1040,"29":1064,"30":1004,"31":214,"32":189,"33":166,"34":1002,"35":167,"36":191,"37":859,"38":204,"39":181,"40":1001,"42":208,"43":198,"44":177,"45":1003,"46":858,"47":190,"48":162,"49":210,"50":171,"51":197,"52":168,"53":194,"54":209,"55":200,"56":192,"57":180,"58":232,"59":222,"60":163,"61":196,"62":217,"64":176,"65":193,"66":172,"67":195,"68":170,"69":173,"70":233,"71":223,"72":218,"73":186,"74":175,"75":224,"76":205,"77":211,"78":235,"79":1101,"80":225,"81":236,"82":1102,"83":1164,"84":1083,"85":1005,"86":861,"87":1179,"88":960,"89":991,"90":1187,"91":880,"92":1149,"93":1033,"94":931,"95":1006,"96":862,"97":1151,"98":917,"99":881,"100":1148,"101":1065,"102":867,"103":952,"104":1152,"105":918,"106":961,"107":1180,"108":992,"109":1188,"110":932,"111":933,"112":968,"113":868,"114":882,"115":1147,"116":1017,"117":1131,"118":1174,"119":1178,"120":1186,"121":869,"122":1051,"123":934,"124":969,"125":975,"126":1066,"127":237,"128":953,"129":1024,"130":1146,"131":883,"132":1145,"133":884,"134":885,"135":1144,"136":886,"137":1143,"138":1025,"139":897,"140":898,"141":899,"142":1026,"143":1142,"144":887,"145":1141,"146":888,"147":889,"148":1140,"149":1189,"150":993,"151":1139,"152":890,"153":1138,"154":891,"155":900,"156":892,"157":1137,"158":1027,"159":901,"160":1136,"161":893,"162":870,"163":1052,"164":954,"165":1041,"166":1018,"167":1165,"168":1084,"169":962,"170":1181,"171":994,"172":1190,"173":1042,"174":935,"175":226,"176":871,"177":1191,"178":995,"179":977,"180":948,"181":1175,"182":1053,"183":955,"184":1182,"185":963,"186":1067,"187":919,"188":1153,"189":920,"190":1154,"191":1055,"192":1054,"193":1056,"194":863,"195":872,"196":1028,"197":921,"198":1155,"199":936,"200":970,"201":1019,"202":1166,"203":1085,"204":1135,"205":894,"206":1034,"207":905,"208":873,"209":937,"210":902,"211":1029,"212":1007,"213":864,"214":1043,"215":1057,"216":956,"217":957,"218":939,"219":1086,"220":1167,"221":1087,"222":1168,"223":1173,"224":1108,"225":978,"226":1044,"227":1183,"228":964,"229":965,"230":1184,"231":1045,"232":874,"233":940,"234":1046,"235":979,"236":903,"237":980,"238":1156,"239":922,"240":1035,"241":906,"242":971,"243":972,"244":878,"245":1134,"246":879,"247":1133,"248":907,"249":1036,"250":908,"251":1132,"252":895,"253":909,"254":1060,"255":981,"256":1068,"257":996,"258":1192,"259":941,"260":865,"261":1008,"262":910,"263":997,"264":1193,"265":982,"266":942,"267":1020,"268":983,"269":1061,"270":949,"271":1176,"272":875,"273":911,"274":1069,"275":1157,"276":923,"277":1158,"278":924,"279":988,"280":984,"281":925,"282":1159,"283":1062,"284":1047,"285":1194,"286":998,"287":1021,"288":1030,"289":1031,"290":1070,"291":1088,"292":1169,"293":958,"294":1195,"295":999,"296":966,"297":1185,"298":944,"299":945,"300":1022,"301":1103,"302":220,"303":1099,"304":1048,"305":927,"306":1161,"307":989,"308":973,"309":1071,"310":1074,"311":1072,"312":1073,"313":912,"314":1037,"315":913,"316":914,"317":1177,"318":950,"319":1049,"320":876,"321":985,"322":915,"323":1038,"324":946,"325":1089,"326":1170,"327":1090,"328":1171,"329":1091,"330":1172,"331":1063,"332":986,"333":928,"334":1162,"335":929,"336":1163,"337":976,"338":231,"339":201,"340":1098,"341":215}', true)); + } catch (\Exception $e) { + var_dump($e->getMessage()); + } +} + +try { + $pdo->query("DROP TABLE b66584"); + $pdo->rollback(); +} catch (\Exception $e) { +} + +function run($pdo, $data) +{ + $bind = join(', ', array_fill(0, count($data), '?')); + + $stmt = $pdo->prepare("SELECT COUNT(*) FROM b66584 WHERE a IN ({$bind})"); + + var_dump(count($data)); + + $stmt->execute($data); + + var_dump($stmt->fetchColumn()); +} + +?> +--EXPECTF-- +int(3) +string(%d) "SQLSTATE%s" +int(340) +string(%d) "SQLSTATE%s" +int(3) +string(%d) "SQLSTATE%s" +int(340) +string(%d) "SQLSTATE%s" diff --git a/ext/pdo_pgsql/tests/bug67462.phpt b/ext/pdo_pgsql/tests/bug67462.phpt new file mode 100644 index 0000000000..888b19c248 --- /dev/null +++ b/ext/pdo_pgsql/tests/bug67462.phpt @@ -0,0 +1,34 @@ +--TEST-- +PDO PgSQL Bug #67462 (PDO_PGSQL::beginTransaction() wrongly throws exception when not in transaction) +--SKIPIF-- +<?php +if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded'); +require dirname(__FILE__) . '/config.inc'; +require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; +PDOTest::skip(); +?> +--FILE-- +<?php + +require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; +$pdo = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); +$pdo->setAttribute (\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); + +$pdo->beginTransaction(); + +try { + $pdo->query("CREATE TABLE b67462 (a int NOT NULL PRIMARY KEY DEFERRABLE INITIALLY DEFERRED)"); + $pdo->query("INSERT INTO b67462 VALUES (1), (1)"); + + var_dump($pdo->inTransaction()); + $pdo->commit(); // This should fail! +} catch (\Exception $e) { + var_dump($pdo->inTransaction()); + var_dump($pdo->beginTransaction()); +} + +?> +--EXPECT-- +bool(true) +bool(false) +bool(true) diff --git a/ext/pdo_pgsql/tests/bug68199.phpt b/ext/pdo_pgsql/tests/bug68199.phpt new file mode 100644 index 0000000000..9abfba2b8e --- /dev/null +++ b/ext/pdo_pgsql/tests/bug68199.phpt @@ -0,0 +1,109 @@ +--TEST-- +Bug #68199 (PDO::pgsqlGetNotify doesn't support NOTIFY payloads) +--SKIPIF-- +<?php # vim:se ft=php: +if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded'); +require dirname(__FILE__) . '/config.inc'; +require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; +PDOTest::skip(); + +$db = PDOTest::factory(); +if (version_compare($db->getAttribute(PDO::ATTR_SERVER_VERSION), '9.0.0') < 0) { + die("skip Requires 9.0+"); +} + +?> +--FILE-- +<?php +require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; +$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); +$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + +// pgsqlGetPid should return something meaningful +$pid = $db->pgsqlGetPid(); +var_dump($pid > 0); + +// No listen, no notifies +var_dump($db->pgsqlGetNotify()); + +// Listen started, no notifies +$db->exec("LISTEN notifies_phpt"); +var_dump($db->pgsqlGetNotify()); + +// No parameters with payload, use default PDO::FETCH_NUM +$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_NUM); +$db->exec("NOTIFY notifies_phpt, 'payload'"); +$notify = $db->pgsqlGetNotify(); +var_dump(count($notify)); +var_dump($notify[0]); +var_dump($notify[1] == $pid); +var_dump($notify[2]); + +// No parameters with payload, use default PDO::FETCH_ASSOC +$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC); +$db->exec("NOTIFY notifies_phpt, 'payload'"); +$notify = $db->pgsqlGetNotify(); +var_dump(count($notify)); +var_dump($notify['message']); +var_dump($notify['pid'] == $pid); +var_dump($notify['payload']); + +// Test PDO::FETCH_NUM as parameter with payload +$db->exec("NOTIFY notifies_phpt, 'payload'"); +$notify = $db->pgsqlGetNotify(PDO::FETCH_NUM); +var_dump(count($notify)); +var_dump($notify[0]); +var_dump($notify[1] == $pid); +var_dump($notify[2]); + +// Test PDO::FETCH_ASSOC as parameter with payload +$db->exec("NOTIFY notifies_phpt, 'payload'"); +$notify = $db->pgsqlGetNotify(PDO::FETCH_ASSOC); +var_dump(count($notify)); +var_dump($notify['message']); +var_dump($notify['pid'] == $pid); +var_dump($notify['payload']); + +// Test PDO::FETCH_BOTH as parameter with payload +$db->exec("NOTIFY notifies_phpt, 'payload'"); +$notify = $db->pgsqlGetNotify(PDO::FETCH_BOTH); +var_dump(count($notify)); +var_dump($notify['message']); +var_dump($notify['pid'] == $pid); +var_dump($notify['payload']); +var_dump($notify[0]); +var_dump($notify[1] == $pid); +var_dump($notify[2]); + +// Verify that there are no notifies queued +var_dump($db->pgsqlGetNotify()); + +?> +--EXPECT-- +bool(true) +bool(false) +bool(false) +int(3) +string(13) "notifies_phpt" +bool(true) +string(7) "payload" +int(3) +string(13) "notifies_phpt" +bool(true) +string(7) "payload" +int(3) +string(13) "notifies_phpt" +bool(true) +string(7) "payload" +int(3) +string(13) "notifies_phpt" +bool(true) +string(7) "payload" +int(6) +string(13) "notifies_phpt" +bool(true) +string(7) "payload" +string(13) "notifies_phpt" +bool(true) +string(7) "payload" +bool(false) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 207764b165..4b1cc31cc8 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -87,6 +87,7 @@ #endif #define CHECK_DEFAULT_LINK(x) if ((x) == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "No PostgreSQL link opened yet"); } +#define FETCH_DEFAULT_LINK() PGG(default_link) ? (int)PGG(default_link)->handle : -1 #ifndef HAVE_PQFREEMEM #define PQfreemem free @@ -1272,7 +1273,8 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) PGconn *pgsql; smart_str str = {0}; zval *args; - int i, connect_type = 0; + uint32_t i; + int connect_type = 0; PGresult *pg_result; args = (zval *)safe_emalloc(ZEND_NUM_ARGS(), sizeof(zval), 0); @@ -1307,7 +1309,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) } else if (ZEND_NUM_ARGS() == 2 ) { /* Safe to add conntype_option, since 2 args was illegal */ connstring = Z_STRVAL(args[0]); convert_to_long_ex(&args[1]); - connect_type = Z_LVAL(args[1]); + connect_type = (int)Z_LVAL(args[1]); } else { host = Z_STRVAL(args[0]); port = Z_STRVAL(args[1]); @@ -1560,7 +1562,7 @@ PHP_FUNCTION(pg_close) } if (argc == 0) { - id = PGG(default_link)? PGG(default_link)->handle : -1; + id = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(id); } @@ -1607,7 +1609,7 @@ static void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type } if (argc == 0) { - id = PGG(default_link)? PGG(default_link)->handle : -1; + id = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(id); } @@ -1754,7 +1756,7 @@ PHP_FUNCTION(pg_parameter_status) id = -1; } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", ¶m, &len) == SUCCESS) { pgsql_link = NULL; - id = PGG(default_link)? PGG(default_link)->handle : -1; + id = FETCH_DEFAULT_LINK(); } else { RETURN_FALSE; } @@ -1787,7 +1789,7 @@ PHP_FUNCTION(pg_ping) id = -1; } else { pgsql_link = NULL; - id = PGG(default_link)? PGG(default_link)->handle : -1; + id = FETCH_DEFAULT_LINK(); } if (pgsql_link == NULL && id == -1) { RETURN_FALSE; @@ -1830,7 +1832,7 @@ PHP_FUNCTION(pg_query) if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &query, &query_len) == FAILURE) { return; } - id = PGG(default_link)? PGG(default_link)->handle : -1; + 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) { @@ -1933,7 +1935,7 @@ PHP_FUNCTION(pg_query_params) if (zend_parse_parameters(argc TSRMLS_CC, "sa", &query, &query_len, &pv_param_arr) == FAILURE) { return; } - id = PGG(default_link)? PGG(default_link)->handle : -1; + 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) { @@ -2049,7 +2051,7 @@ PHP_FUNCTION(pg_prepare) if (zend_parse_parameters(argc TSRMLS_CC, "ss", &stmtname, &stmtname_len, &query, &query_len) == FAILURE) { return; } - id = PGG(default_link)? PGG(default_link)->handle : -1; + 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) { @@ -2136,7 +2138,7 @@ PHP_FUNCTION(pg_execute) if (zend_parse_parameters(argc TSRMLS_CC, "sa/", &stmtname, &stmtname_len, &pv_param_arr)==FAILURE) { return; } - id = PGG(default_link)? PGG(default_link)->handle : -1; + 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) { @@ -2414,7 +2416,7 @@ PHP_FUNCTION(pg_field_table) RETURN_FALSE; } - oid = PQftable(pg_result->result, fnum); + oid = PQftable(pg_result->result, (int)fnum); if (InvalidOid == oid) { RETURN_FALSE; @@ -2509,20 +2511,20 @@ static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_typ switch (entry_type) { case PHP_PG_FIELD_NAME: - RETURN_STRING(PQfname(pgsql_result, field)); + RETURN_STRING(PQfname(pgsql_result, (int)field)); break; case PHP_PG_FIELD_SIZE: - RETURN_LONG(PQfsize(pgsql_result, field)); + RETURN_LONG(PQfsize(pgsql_result, (int)field)); break; case PHP_PG_FIELD_TYPE: { - char *name = get_field_name(pg_result->conn, PQftype(pgsql_result, field), &EG(regular_list) TSRMLS_CC); + char *name = get_field_name(pg_result->conn, PQftype(pgsql_result, (int)field), &EG(regular_list) TSRMLS_CC); RETVAL_STRING(name); efree(name); } break; case PHP_PG_FIELD_TYPE_OID: - oid = PQftype(pgsql_result, field); + oid = PQftype(pgsql_result, (int)field); #if UINT_MAX > ZEND_LONG_MAX if (oid > ZEND_LONG_MAX) { smart_str s = {0}; @@ -2627,26 +2629,30 @@ PHP_FUNCTION(pg_fetch_result) RETURN_FALSE; } } else { - pgsql_row = row; - if (pgsql_row < 0 || pgsql_row >= PQntuples(pgsql_result)) { + 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", row, Z_LVAL_P(result)); RETURN_FALSE; } + pgsql_row = (int)row; } switch (Z_TYPE_P(field)) { 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"); + RETURN_FALSE; + } break; default: convert_to_long_ex(field); - field_offset = Z_LVAL_P(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"); + RETURN_FALSE; + } + field_offset = (int)Z_LVAL_P(field); break; } - if (field_offset < 0 || field_offset >= PQnfields(pgsql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified"); - RETURN_FALSE; - } if (PQgetisnull(pgsql_result, pgsql_row, field_offset)) { RETVAL_NULL(); @@ -2712,13 +2718,13 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_ pgsql_result = pg_result->result; if (use_row) { - pgsql_row = row; - pg_result->row = pgsql_row; - if (pgsql_row < 0 || pgsql_row >= PQntuples(pgsql_result)) { + 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", row, Z_LVAL_P(result)); RETURN_FALSE; } + pgsql_row = (int)row; + pg_result->row = pgsql_row; } else { /* If 2nd param is NULL, use internal row counter to access next row */ pgsql_row = pg_result->row; @@ -2898,7 +2904,7 @@ PHP_FUNCTION(pg_fetch_all_columns) pgsql_result = pg_result->result; num_fields = PQnfields(pgsql_result); - if (colno >= num_fields || colno < 0) { + if (colno >= (zend_long)num_fields || colno < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column number '%pd'", colno); RETURN_FALSE; } @@ -2910,10 +2916,10 @@ PHP_FUNCTION(pg_fetch_all_columns) } for (pg_row = 0; pg_row < pg_numrows; pg_row++) { - if (PQgetisnull(pgsql_result, pg_row, colno)) { + if (PQgetisnull(pgsql_result, pg_row, (int)colno)) { add_next_index_null(return_value); } else { - add_next_index_string(return_value, PQgetvalue(pgsql_result, pg_row, colno)); + add_next_index_string(return_value, PQgetvalue(pgsql_result, pg_row, (int)colno)); } } } @@ -2938,7 +2944,7 @@ PHP_FUNCTION(pg_result_seek) } /* seek to offset */ - pg_result->row = row; + pg_result->row = (int)row; RETURN_TRUE; } /* }}} */ @@ -2978,28 +2984,32 @@ static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type) RETURN_FALSE; } } else { - pgsql_row = row; - if (pgsql_row < 0 || pgsql_row >= PQntuples(pgsql_result)) { + 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", row, Z_LVAL_P(result)); RETURN_FALSE; } + pgsql_row = (int)row; } switch (Z_TYPE_P(field)) { case IS_STRING: 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"); + RETURN_FALSE; + } break; default: convert_to_long_ex(field); - field_offset = Z_LVAL_P(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"); + RETURN_FALSE; + } + field_offset = (int)Z_LVAL_P(field); break; } - if (field_offset < 0 || field_offset >= PQnfields(pgsql_result)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified"); - RETURN_FALSE; - } switch (entry_type) { case PHP_PG_DATA_LENGTH: @@ -3092,7 +3102,7 @@ PHP_FUNCTION(pg_trace) PGconn *pgsql; FILE *fp = NULL; php_stream *stream; - id = PGG(default_link)? PGG(default_link)->handle : -1; + id = FETCH_DEFAULT_LINK(); if (zend_parse_parameters(argc TSRMLS_CC, "s|sr", &z_filename, &z_filename_len, &mode, &mode_len, &pgsql_link) == FAILURE) { return; @@ -3137,7 +3147,7 @@ PHP_FUNCTION(pg_untrace) } if (argc == 0) { - id = PGG(default_link)? PGG(default_link)->handle : -1; + id = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(id); } @@ -3170,7 +3180,7 @@ PHP_FUNCTION(pg_lo_create) } if (pgsql_link == NULL) { - id = PGG(default_link)? PGG(default_link)->handle : -1; + id = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(id); if (id == -1) { RETURN_FALSE; @@ -3263,7 +3273,7 @@ PHP_FUNCTION(pg_lo_unlink) php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed"); RETURN_FALSE; } - id = PGG(default_link)? PGG(default_link)->handle : -1; + id = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(id); } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, @@ -3273,7 +3283,7 @@ PHP_FUNCTION(pg_lo_unlink) RETURN_FALSE; } oid = (Oid)oid_long; - id = PGG(default_link)? PGG(default_link)->handle : -1; + id = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(id); } else { @@ -3335,7 +3345,7 @@ PHP_FUNCTION(pg_lo_open) php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed"); RETURN_FALSE; } - id = PGG(default_link)? PGG(default_link)->handle : -1; + id = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(id); } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, @@ -3345,7 +3355,7 @@ PHP_FUNCTION(pg_lo_open) RETURN_FALSE; } oid = (Oid)oid_long; - id = PGG(default_link)? PGG(default_link)->handle : -1; + id = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(id); } else { @@ -3447,7 +3457,8 @@ PHP_FUNCTION(pg_lo_read) { zval *pgsql_id; zend_long len; - int buf_len = PGSQL_LO_READ_BUF_SIZE, nbytes, argc = ZEND_NUM_ARGS(); + size_t buf_len = PGSQL_LO_READ_BUF_SIZE; + int nbytes, argc = ZEND_NUM_ARGS(); zend_string *buf; pgLofp *pgsql; @@ -3458,7 +3469,7 @@ PHP_FUNCTION(pg_lo_read) ZEND_FETCH_RESOURCE(pgsql, pgLofp *, pgsql_id, -1, "PostgreSQL large object", le_lofp); if (argc > 1) { - buf_len = len; + buf_len = len < 0 ? 0 : len; } buf = zend_string_alloc(buf_len, 0); @@ -3490,7 +3501,7 @@ PHP_FUNCTION(pg_lo_write) } if (argc > 2) { - if (z_len > str_len) { + 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); RETURN_FALSE; } @@ -3557,7 +3568,7 @@ PHP_FUNCTION(pg_lo_import) } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, "p|z", &file_in, &name_len, &oid) == SUCCESS) { - id = PGG(default_link)? PGG(default_link)->handle : -1; + id = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(id); } /* old calling convention, deprecated since PHP 4.2 */ @@ -3666,7 +3677,7 @@ PHP_FUNCTION(pg_lo_export) RETURN_FALSE; } oid = (Oid)oid_long; - id = PGG(default_link)? PGG(default_link)->handle : -1; + id = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(id); } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, @@ -3677,7 +3688,7 @@ PHP_FUNCTION(pg_lo_export) php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed"); RETURN_FALSE; } - id = PGG(default_link)? PGG(default_link)->handle : -1; + id = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(id); } else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC, @@ -3741,9 +3752,9 @@ PHP_FUNCTION(pg_lo_seek) #if HAVE_PG_LO64 if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) { - result = lo_lseek64((PGconn *)pgsql->conn, pgsql->lofd, offset, whence); + result = lo_lseek64((PGconn *)pgsql->conn, pgsql->lofd, offset, (int)whence); } else { - result = lo_lseek((PGconn *)pgsql->conn, pgsql->lofd, offset, whence); + result = lo_lseek((PGconn *)pgsql->conn, pgsql->lofd, (int)offset, (int)whence); } #else result = lo_lseek((PGconn *)pgsql->conn, pgsql->lofd, offset, whence); @@ -3833,7 +3844,7 @@ PHP_FUNCTION(pg_set_error_verbosity) if (zend_parse_parameters(argc TSRMLS_CC, "l", &verbosity) == FAILURE) { return; } - id = PGG(default_link)? PGG(default_link)->handle : -1; + id = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(id); } else { if (zend_parse_parameters(argc TSRMLS_CC, "rl", &pgsql_link, &verbosity) == FAILURE) { @@ -3871,7 +3882,7 @@ PHP_FUNCTION(pg_set_client_encoding) if (zend_parse_parameters(argc TSRMLS_CC, "s", &encoding, &encoding_len) == FAILURE) { return; } - id = PGG(default_link)? PGG(default_link)->handle : -1; + id = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(id); } else { if (zend_parse_parameters(argc TSRMLS_CC, "rs", &pgsql_link, &encoding, &encoding_len) == FAILURE) { @@ -3902,7 +3913,7 @@ PHP_FUNCTION(pg_client_encoding) } if (argc == 0) { - id = PGG(default_link)? PGG(default_link)->handle : -1; + id = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(id); } @@ -3937,7 +3948,7 @@ PHP_FUNCTION(pg_end_copy) } if (argc == 0) { - id = PGG(default_link)? PGG(default_link)->handle : -1; + id = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(id); } @@ -3972,7 +3983,7 @@ PHP_FUNCTION(pg_put_line) if (zend_parse_parameters(argc TSRMLS_CC, "s", &query, &query_len) == FAILURE) { return; } - id = PGG(default_link) ? PGG(default_link)->handle : -1; + id = FETCH_DEFAULT_LINK(); CHECK_DEFAULT_LINK(id); } else { if (zend_parse_parameters(argc TSRMLS_CC, "rs", &pgsql_link, &query, &query_len) == FAILURE) { @@ -4192,7 +4203,7 @@ PHP_FUNCTION(pg_copy_from) if(Z_STRLEN_P(tmp) > 0 && *(query + Z_STRLEN_P(tmp) - 1) != '\n') { strlcat(query, "\n", Z_STRLEN_P(tmp) + 2); } - if (PQputCopyData(pgsql, query, strlen(query)) != 1) { + if (PQputCopyData(pgsql, query, (int)strlen(query)) != 1) { efree(query); PHP_PQ_ERROR("copy failed: %s", pgsql); RETURN_FALSE; @@ -4270,7 +4281,7 @@ PHP_FUNCTION(pg_escape_string) return; } pgsql_link = NULL; - id = PGG(default_link)? PGG(default_link)->handle : -1; + id = FETCH_DEFAULT_LINK(); break; default: @@ -4315,7 +4326,7 @@ PHP_FUNCTION(pg_escape_bytea) return; } pgsql_link = NULL; - id = PGG(default_link)? PGG(default_link)->handle : -1; + id = FETCH_DEFAULT_LINK(); break; default: @@ -4488,7 +4499,7 @@ static void php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAMETERS, int escape_l return; } pgsql_link = NULL; - id = PGG(default_link)? PGG(default_link)->handle : - 1; + id = FETCH_DEFAULT_LINK(); break; default: @@ -4598,7 +4609,7 @@ PHP_FUNCTION(pg_result_error_field) #endif |PG_DIAG_CONTEXT|PG_DIAG_SOURCE_FILE|PG_DIAG_SOURCE_LINE |PG_DIAG_SOURCE_FUNCTION)) { - field = (char *)PQresultErrorField(pgsql_result, fieldcode); + field = (char *)PQresultErrorField(pgsql_result, (int)fieldcode); if (field == NULL) { RETURN_NULL(); } else { diff --git a/ext/pgsql/pgsql.dsp b/ext/pgsql/pgsql.dsp deleted file mode 100644 index eab3d6c0de..0000000000 --- a/ext/pgsql/pgsql.dsp +++ /dev/null @@ -1,167 +0,0 @@ -# Microsoft Developer Studio Project File - Name="pgsql" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=pgsql - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "pgsql.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "pgsql.mak" CFG="pgsql - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "pgsql - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "pgsql - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "pgsql - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "pgsql - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "pgsql - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PGSQL_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\php_build\include\pgsql" /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D "NDEBUG" /D ZEND_DEBUG=0 /D "PGSQL_EXPORTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_PGSQL" /D HAVE_PGSQL=1 /D "HAVE_PQCMDTUPLES" /D "HAVE_PQCLIENTENCODING" /D "HAVE_PQESCAPE" /D "HAVE_PG_CONFIG_H" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libpqdll.lib php7ts.lib /nologo /dll /machine:I386 /nodefaultlib:"msvcrt.lib" /out:"../../Release/pgsql.dll" /libpath:"..\..\..\PostgreSQL\lib" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "pgsql - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PGSQL_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\php_build\include\pgsql" /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "PGSQL_EXPORTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_PGSQL" /D HAVE_PGSQL=1 /D "HAVE_PQCMDTUPLES" /D "HAVE_PQCLIENTENCODING" /D "HAVE_PQESCAPE" /D "HAVE_PG_CONFIG_H" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrtd.lib" /out:"../../Debug/pgsql.dll" /pdbtype:sept
-
-!ELSEIF "$(CFG)" == "pgsql - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\PostgreSQL\include" /I "..\..\..\bindlib_w32" /D "NDEBUG" /D "ZTS" /D "PGSQL_EXPORTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_PGSQL" /D HAVE_PGSQL=1 /D ZTS=1 /FD /c
-# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\php_build\include\pgsql" /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D "NDEBUG" /D "ZTS" /D ZEND_DEBUG=0 /D "PGSQL_EXPORTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_PGSQL" /D HAVE_PGSQL=1 /D "HAVE_PQCMDTUPLES" /D "HAVE_PQCLIENTENCODING" /D "HAVE_PQESCAPE" /D "HAVE_PG_CONFIG_H" /FR /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libpqdll.lib php7ts.lib /nologo /dll /machine:I386 /libpath:"..\..\..\PostgreSQL\lib" /libpath:"..\..\Release_TS"
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libpq.lib php7ts.lib /nologo /dll /machine:I386 /out:"../../Release_TS/php_pgsql.dll" /libpath:"..\..\..\php_build\postgresql\src\interfaces\libpq\Release" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "pgsql - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "PGSQL_EXPORTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_PGSQL" /D HAVE_PGSQL=1 /D ZTS=1 /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\php_build\include\pgsql" /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D "_DEBUG" /D "ZTS" /D ZEND_DEBUG=1 /D "PGSQL_EXPORTS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "COMPILE_DL_PGSQL" /D HAVE_PGSQL=1 /D "HAVE_PQCMDTUPLES" /D "HAVE_PQCLIENTENCODING" /D "HAVE_PQESCAPE" /D "HAVE_PG_CONFIG_H" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libpq.lib /nologo /dll /debug /machine:I386 /out:"../../Debug_TS/pgsql.dll" /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "pgsql - Win32 Release"
-# Name "pgsql - Win32 Debug"
-# Name "pgsql - Win32 Release_TS"
-# Name "pgsql - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\pgsql.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_pgsql.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/pgsql/tests/config.inc b/ext/pgsql/tests/config.inc index be652b2507..e9944de793 100644 --- a/ext/pgsql/tests/config.inc +++ b/ext/pgsql/tests/config.inc @@ -1,10 +1,12 @@ <?php + // These vars are used to connect db and create test table. -// values can be set to meet your environment +// values can be set to meet your environment with the +// environment var PGSQL_TEST_CONNSTR + +// "test" database must exist. i.e. "createdb test" before testing +$conn_str = getenv('PGSQL_TEST_CONNSTR') ?: "host=localhost dbname=test port=5432"; // connection string -// "test" database must be existed. i.e. "createdb test" before testing -// PostgreSQL uses login name as username, user must have access to "test" database. -$conn_str = "user=test password=test host=localhost dbname=test port=5432"; // connection string $table_name = "php_pgsql_test"; // test table that will be created $table_name_92 = "php_pgsql_test_92"; // test table that will be created $num_test_record = 1000; // Number of records to create diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 8f17c771d1..0903f6c952 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -2072,54 +2072,6 @@ static int php_check_dots(const char *element, int n) /* {{{ */ #define IS_BACKSLASH(c) ((c) == '/') -#ifdef COMPILE_DL_PHAR -/* stupid-ass non-extern declaration in tsrm_strtok.h breaks dumbass MS compiler */ -static inline int in_character_class(char ch, const char *delim) /* {{{ */ -{ - while (*delim) { - if (*delim == ch) { - return 1; - } - ++delim; - } - return 0; -} -/* }}} */ - -char *tsrm_strtok_r(char *s, const char *delim, char **last) /* {{{ */ -{ - char *token; - - if (s == NULL) { - s = *last; - } - - while (*s && in_character_class(*s, delim)) { - ++s; - } - - if (!*s) { - return NULL; - } - - token = s; - - while (*s && !in_character_class(*s, delim)) { - ++s; - } - - if (!*s) { - *last = s; - } else { - *s = '\0'; - *last = s + 1; - } - - return token; -} -/* }}} */ -#endif - /** * Remove .. and . references within a phar filename */ @@ -3355,6 +3307,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); } zend_catch { failed = 1; diff --git a/ext/pspell/pspell.dsp b/ext/pspell/pspell.dsp deleted file mode 100644 index 87b7683493..0000000000 --- a/ext/pspell/pspell.dsp +++ /dev/null @@ -1,112 +0,0 @@ -# Microsoft Developer Studio Project File - Name="pspell" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=pspell - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "pspell.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "pspell.mak" CFG="pspell - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "pspell - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "pspell - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "pspell - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "pspell___Win32_Debug_TS"
-# PROP BASE Intermediate_Dir "pspell___Win32_Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "..\..\..\aspell\include\pspell" /I "..\..\..\php_build\include\pspell." /D ZEND_DEBUG=1 /D "_DEBUG" /D ZTS=1 /D HAVE_PSPELL=1 /D "COMPILE_DL_PSPELL" /D "WIN32" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSPELL_EXPORTS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php7ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_pspell.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-# ADD LINK32 php7ts_debug.lib aspell-15.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_pspell.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\aspell\lib"
-
-!ELSEIF "$(CFG)" == "pspell - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "pspell___Win32_Release_TS"
-# PROP BASE Intermediate_Dir "pspell___Win32_Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSPELL_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "..\..\..\aspell\include\pspell" /I "..\..\..\php_build\include\pspell" /D ZEND_DEBUG=0 /D "NDEBUG" /D ZTS=1 /D HAVE_PSPELL=1 /D "COMPILE_DL_PSPELL" /D "WIN32" /D "ZEND_WIN32" /D "PHP_WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PSPELL_EXPORTS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php7ts.lib aspell-15.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_pspell.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\aspell\lib"
-
-!ENDIF
-
-# Begin Target
-
-# Name "pspell - Win32 Debug_TS"
-# Name "pspell - Win32 Release_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\pspell.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_pspell.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/readline/readline_cli.c b/ext/readline/readline_cli.c index ff0671ce9f..48ab488763 100644 --- a/ext/readline/readline_cli.c +++ b/ext/readline/readline_cli.c @@ -270,12 +270,6 @@ static int cli_is_valid_code(char *code, int len, zend_string **prompt TSRMLS_DC } valid_end = 0; break; - case '%': - if (!CG(asp_tags)) { - valid_end = 0; - break; - } - /* no break */ case '?': if (code[i+1] == '>') { i++; @@ -360,7 +354,6 @@ static int cli_is_valid_code(char *code, int len, zend_string **prompt TSRMLS_DC break; case outside: if ((CG(short_tags) && !strncmp(code+i-1, "<?", 2)) - || (CG(asp_tags) && !strncmp(code+i-1, "<%", 2)) || (i > 3 && !strncmp(code+i-4, "<?php", 5)) ) { code_type = body; diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index c99f066834..3d44c35b62 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -83,7 +83,7 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection) /* Method macros */ #define METHOD_NOTSTATIC(ce) \ - if (!Z_OBJ(EG(This)) || !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) { \ + 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)); \ return; \ } \ @@ -116,7 +116,7 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection) /* {{{ Smart string functions */ typedef struct _string { zend_string *buf; - int alloced; + size_t alloced; } string; static void string_init(string *str) @@ -129,16 +129,16 @@ static void string_init(string *str) static string *string_printf(string *str, const char *format, ...) { - int len; + size_t len; va_list arg; char *s_tmp; va_start(arg, format); len = zend_vspprintf(&s_tmp, 0, format, arg); if (len) { - register int nlen = (str->buf->len + 1 + len + (1024 - 1)) & ~(1024 - 1); + register size_t nlen = (str->buf->len + 1 + len + (1024 - 1)) & ~(1024 - 1); if (str->alloced < nlen) { - int old_len = str->buf->len; + size_t old_len = str->buf->len; str->alloced = nlen; str->buf = zend_string_realloc(str->buf, str->alloced, 0); str->buf->len = old_len; @@ -151,11 +151,11 @@ static string *string_printf(string *str, const char *format, ...) return str; } -static string *string_write(string *str, char *buf, int len) +static string *string_write(string *str, char *buf, size_t len) { - register int nlen = (str->buf->len + 1 + len + (1024 - 1)) & ~(1024 - 1); + register size_t nlen = (str->buf->len + 1 + len + (1024 - 1)) & ~(1024 - 1); if (str->alloced < nlen) { - int old_len = str->buf->len; + size_t old_len = str->buf->len; str->alloced = nlen; str->buf = zend_string_realloc(str->buf, str->alloced, 0); str->buf->len = old_len; @@ -603,7 +603,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in { zend_string *key; zend_ulong num_index; - uint len = mptr->common.function_name->len; + size_t len = mptr->common.function_name->len; /* Do not display old-style inherited constructors */ if ((mptr->common.fn_flags & ZEND_ACC_CTOR) == 0 @@ -809,7 +809,7 @@ static void _function_string(string *str, zend_function *fptr, zend_class_entry string param_indent; zend_function *overwrites; zend_string *lc_name; - unsigned int lc_name_len; + size_t lc_name_len; /* TBD: Repair indenting of doc comment (or is this to be done in the parser?) * What's "wrong" is that any whitespace before the doc comment start is @@ -995,9 +995,12 @@ static int _extension_class_string(zval *el TSRMLS_DC, int num_args, va_list arg int *num_classes = va_arg(args, int*); if ((ce->type == ZEND_INTERNAL_CLASS) && ce->info.internal.module && !strcasecmp(ce->info.internal.module->name, module->name)) { - string_printf(str, "\n"); - _class_string(str, ce, NULL, indent TSRMLS_CC); - (*num_classes)++; + /* 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); + (*num_classes)++; + } } return ZEND_HASH_APPLY_KEEP; } @@ -1193,7 +1196,7 @@ static void reflection_extension_factory(zval *object, const char *name_str TSRM { reflection_object *intern; zval name; - int name_len = strlen(name_str); + size_t name_len = strlen(name_str); zend_string *lcname; struct _zend_module_entry *module; @@ -2138,7 +2141,7 @@ ZEND_METHOD(reflection_parameter, __construct) /* First, find the function */ switch (Z_TYPE_P(reference)) { case IS_STRING: { - unsigned int lcname_len; + size_t lcname_len; char *lcname; lcname_len = Z_STRLEN_P(reference); @@ -2157,7 +2160,7 @@ ZEND_METHOD(reflection_parameter, __construct) case IS_ARRAY: { zval *classref; zval *method; - unsigned int lcname_len; + size_t lcname_len; char *lcname; if (((classref =zend_hash_index_find(Z_ARRVAL_P(reference), 0)) == NULL) @@ -2221,7 +2224,7 @@ ZEND_METHOD(reflection_parameter, __construct) /* Now, search for the parameter */ arg_info = fptr->common.arg_info; if (Z_TYPE_P(parameter) == IS_LONG) { - position= Z_LVAL_P(parameter); + position= (int)Z_LVAL_P(parameter); if (position < 0 || (uint32_t)position >= fptr->common.num_args) { if (fptr->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) { if (fptr->type != ZEND_OVERLOADED_FUNCTION) { @@ -2399,7 +2402,7 @@ ZEND_METHOD(reflection_parameter, getClass) } else { zend_string *name = zend_string_init(param->arg_info->class_name, param->arg_info->class_name_len, 0); ce = zend_lookup_class(name TSRMLS_CC); - zend_string_free(name); + zend_string_release(name); if (!ce) { zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Class %s does not exist", param->arg_info->class_name); @@ -3704,10 +3707,10 @@ ZEND_METHOD(reflection_class, getMethod) /* }}} */ /* {{{ _addmethod */ -static void _addmethod(zend_function *mptr, zend_class_entry *ce, zval *retval, long filter, zval *obj TSRMLS_DC) +static void _addmethod(zend_function *mptr, zend_class_entry *ce, zval *retval, zend_long filter, zval *obj TSRMLS_DC) { zval method; - uint len = mptr->common.function_name->len; + size_t len = mptr->common.function_name->len; zend_function *closure; if (mptr->common.fn_flags & filter) { if (ce == zend_ce_closure && obj && (len == sizeof(ZEND_INVOKE_FUNC_NAME)-1) @@ -3816,7 +3819,7 @@ ZEND_METHOD(reflection_class, getProperty) zend_property_info *property_info; zend_string *name, *classname; char *tmp, *str_name; - int classname_len, str_name_len; + size_t classname_len, str_name_len; METHOD_NOTSTATIC(reflection_class_ptr); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &name) == FAILURE) { @@ -3859,10 +3862,10 @@ ZEND_METHOD(reflection_class, getProperty) if (!EG(exception)) { zend_throw_exception_ex(reflection_exception_ptr, -1 TSRMLS_CC, "Class %s does not exist", classname->val); } - zend_string_free(classname); + zend_string_release(classname); return; } - zend_string_free(classname); + 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); @@ -3919,9 +3922,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) == &EG(std_property_info)) { - EG(std_property_info).flags = ZEND_ACC_IMPLICIT_PUBLIC; - reflection_property_factory(ce, &EG(std_property_info), &property TSRMLS_CC); + if (zend_get_property_info(ce, hash_key->key, 1 TSRMLS_CC) == 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); add_next_index_zval(retval, &property); } return 0; @@ -4154,7 +4162,7 @@ ZEND_METHOD(reflection_class, isInstance) return; } GET_REFLECTION_OBJECT_PTR(ce); - RETURN_BOOL(HAS_CLASS_ENTRY(*object) && instanceof_function(Z_OBJCE_P(object), ce TSRMLS_CC)); + RETURN_BOOL(instanceof_function(Z_OBJCE_P(object), ce TSRMLS_CC)); } /* }}} */ @@ -5320,11 +5328,20 @@ static int add_extension_class(zval *zv TSRMLS_DC, int num_args, va_list args, z int add_reflection_class = va_arg(args, int); if ((ce->type == ZEND_INTERNAL_CLASS) && ce->info.internal.module && !strcasecmp(ce->info.internal.module->name, module->name)) { + zend_string *name; + + if (zend_binary_strcasecmp(ce->name->val, ce->name->len, hash_key->key->val, hash_key->key->len)) { + /* This is an class alias, use alias name */ + name = hash_key->key; + } else { + /* Use class name */ + name = ce->name; + } if (add_reflection_class) { zend_reflection_class_factory(ce, &zclass TSRMLS_CC); - zend_hash_update(Z_ARRVAL_P(class_array), ce->name, &zclass); + zend_hash_update(Z_ARRVAL_P(class_array), name, &zclass); } else { - add_next_index_str(class_array, zend_string_copy(ce->name)); + add_next_index_str(class_array, zend_string_copy(name)); } } return ZEND_HASH_APPLY_KEEP; @@ -5390,7 +5407,7 @@ ZEND_METHOD(reflection_extension, getDependencies) while(dep->name) { zend_string *relation; char *rel_type; - int len = 0; + size_t len = 0; switch(dep->type) { case MODULE_DEP_REQUIRED: @@ -6034,7 +6051,7 @@ ZEND_END_ARG_INFO() static const zend_function_entry reflection_zend_extension_functions[] = { ZEND_ME(reflection, __clone, arginfo_reflection__void, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) ZEND_ME(reflection_zend_extension, export, arginfo_reflection_extension_export, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - ZEND_ME(reflection_zend_extension, __construct, arginfo_reflection_extension___construct, 0) + ZEND_ME(reflection_zend_extension, __construct, arginfo_reflection_zend_extension___construct, 0) ZEND_ME(reflection_zend_extension, __toString, arginfo_reflection__void, 0) ZEND_ME(reflection_zend_extension, getName, arginfo_reflection__void, 0) ZEND_ME(reflection_zend_extension, getVersion, arginfo_reflection__void, 0) diff --git a/ext/session/session.c b/ext/session/session.c index 63bb00e06a..dae965b048 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -2105,10 +2105,7 @@ static PHP_FUNCTION(session_unset) } IF_SESSION_VARS() { - HashTable *ht_sess_var; - - SEPARATE_ZVAL_IF_NOT_REF(&PS(http_session_vars)); - ht_sess_var = Z_ARRVAL_P(Z_REFVAL(PS(http_session_vars))); + HashTable *ht_sess_var = Z_ARRVAL_P(Z_REFVAL(PS(http_session_vars))); /* Clean $_SESSION. */ zend_hash_clean(ht_sess_var); diff --git a/ext/shmop/shmop.dsp b/ext/shmop/shmop.dsp deleted file mode 100644 index 02afb0a847..0000000000 --- a/ext/shmop/shmop.dsp +++ /dev/null @@ -1,107 +0,0 @@ -# Microsoft Developer Studio Project File - Name="shmop" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=shmop - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "shmop.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "shmop.mak" CFG="shmop - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "shmop - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "shmop - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "shmop - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SHMOP_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\\" /I "..\..\main" /I "..\..\TSRM" /I "..\..\ZEND" /D "WIN32" /D ZEND_WIN32=1 /D PHP_WIN32=1 /D "NDEBUG" /D "PHP_EXPORTS" /D "HAVE_SHMOP" /D COMPILE_DL_SHMOP=1 /D ZEND_DEBUG=0 /D "ZTS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php7ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_shmop.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "shmop - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SHMOP_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\\" /I "..\..\main" /I "..\..\TSRM" /I "..\..\ZEND" /D "WIN32" /D ZEND_DEBUG=1 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_EXPORTS" /D "COMPILE_DL_SHMOP" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_SHMOP=1 /D ZTS=1 /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php7ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_shmop.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "shmop - Win32 Release_TS"
-# Name "shmop - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\shmop.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_shmop.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 366a6f0d3b..361b0824eb 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -267,10 +267,8 @@ static zval *sxe_prop_dim_read(zval *object, zval *member, zend_bool elements, z name = NULL; } else { if (Z_TYPE_P(member) != IS_STRING) { - tmp_zv = *member; - zval_copy_ctor(&tmp_zv); + ZVAL_STR(&tmp_zv, zval_get_string(member)); member = &tmp_zv; - convert_to_string(member); } name = Z_STRVAL_P(member); } @@ -476,9 +474,7 @@ static int sxe_prop_dim_write(zval *object, zval *member, zval *value, zend_bool } } else { if (Z_TYPE_P(member) != IS_STRING) { - trim_zv = *member; - zval_copy_ctor(&trim_zv); - convert_to_string(&trim_zv); + 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); zval_dtor(&trim_zv); member = &tmp_zv; @@ -736,10 +732,8 @@ static int sxe_prop_dim_exists(zval *object, zval *member, int check_empty, zend zval tmp_zv; if (Z_TYPE_P(member) != IS_STRING && Z_TYPE_P(member) != IS_LONG) { - tmp_zv = *member; - zval_copy_ctor(&tmp_zv); + ZVAL_STR(&tmp_zv, zval_get_string(member)); member = &tmp_zv; - convert_to_string(member); } sxe = Z_SXEOBJ_P(object); @@ -866,10 +860,8 @@ static void sxe_prop_dim_delete(zval *object, zval *member, zend_bool elements, int test = 0; if (Z_TYPE_P(member) != IS_STRING && Z_TYPE_P(member) != IS_LONG) { - tmp_zv = *member; - zval_copy_ctor(&tmp_zv); + ZVAL_STR(&tmp_zv, zval_get_string(member)); member = &tmp_zv; - convert_to_string(member); } sxe = Z_SXEOBJ_P(object); @@ -1958,7 +1950,6 @@ static zend_object_handlers sxe_object_handlers = { /* {{{ */ NULL, /* zend_get_std_object_handlers()->get_method,*/ NULL, /* zend_get_std_object_handlers()->call_method,*/ NULL, /* zend_get_std_object_handlers()->get_constructor, */ - NULL, /* zend_get_std_object_handlers()->get_class_entry,*/ NULL, /* zend_get_std_object_handlers()->get_class_name,*/ sxe_objects_compare, sxe_object_cast, @@ -2580,7 +2571,6 @@ PHP_MINIT_FUNCTION(simplexml) sxe_object_handlers.clone_obj = sxe_object_clone; sxe_object_handlers.get_method = zend_get_std_object_handlers()->get_method; sxe_object_handlers.get_constructor = zend_get_std_object_handlers()->get_constructor; - sxe_object_handlers.get_class_entry = zend_get_std_object_handlers()->get_class_entry; sxe_object_handlers.get_class_name = zend_get_std_object_handlers()->get_class_name; sxe_class_entry->serialize = zend_class_serialize_deny; sxe_class_entry->unserialize = zend_class_unserialize_deny; diff --git a/ext/simplexml/simplexml.dsp b/ext/simplexml/simplexml.dsp deleted file mode 100644 index 5663dc13b0..0000000000 --- a/ext/simplexml/simplexml.dsp +++ /dev/null @@ -1,111 +0,0 @@ -# Microsoft Developer Studio Project File - Name="simplexml" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=simplexml - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "simplexml.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "simplexml.mak" CFG="simplexml - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "simplexml - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "simplexml - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "simplexml - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "c:\php\5d\extensions"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIMPLEXML_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\php7" /I "..\..\..\php7\main" /I "..\..\..\php7\Zend" /I "..\..\..\php7\TSRM" /D ZEND_DEBUG=1 /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D COMPILE_DL_SIMPLEXML=1 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIMPLEXML_EXPORTS" /D "LIBXML_THREAD_ENABLED" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php7ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\php7\Debug_TS"
-
-!ELSEIF "$(CFG)" == "simplexml - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIMPLEXML_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\..\php7\main" /I "..\..\..\php7\Zend" /I "..\..\..\php7\TSRM" /I "..\..\..\php7\win32" /I "..\..\..\php7" /D ZTS=1 /D ZEND_DEBUG=0 /D "ZEND_WIN32" /D "PHP_WIN32" /D COMPILE_DL_SIMPLEXML=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SIMPLEXML_EXPORTS" /D "LIBXML_THREAD_ENABLED" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php7ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /libpath:"..\..\..\php7\Release_TS" /libpath:"..\..\..\php7\Release_TS_Inline"
-
-!ENDIF
-
-# Begin Target
-
-# Name "simplexml - Win32 Debug_TS"
-# Name "simplexml - Win32 Release_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\simplexml.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_simplexml.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/skeleton/skeleton.dsp b/ext/skeleton/skeleton.dsp deleted file mode 100644 index fdbf245671..0000000000 --- a/ext/skeleton/skeleton.dsp +++ /dev/null @@ -1,113 +0,0 @@ -# Microsoft Developer Studio Project File - Name="extname" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=extname - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "extname.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "extname.mak" CFG="extname - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "extname - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "extname - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "extname - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_EXTNAME" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXTNAME_EXPORTS" /D "COMPILE_DL_EXTNAME" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXTNAME=1 /D "LIBZEND_EXPORTS" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_extname.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "extname - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_EXTNAME" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXTNAME_EXPORTS" /D "COMPILE_DL_EXTNAME" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_EXTNAME=1 /D "LIBZEND_EXPORTS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts_debug.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_extname.dll" /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "extname - Win32 Release_TS"
-# Name "extname - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\extname.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_extname.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/snmp/snmp.dsp b/ext/snmp/snmp.dsp deleted file mode 100644 index fa1468beda..0000000000 --- a/ext/snmp/snmp.dsp +++ /dev/null @@ -1,109 +0,0 @@ -# Microsoft Developer Studio Project File - Name="snmp" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=snmp - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "snmp.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "snmp.mak" CFG="snmp - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "snmp - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "snmp - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "snmp - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_SNMP" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SNMP_EXPORTS" /D "COMPILE_DL_SNMP" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_SNMP=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib libsnmp.lib wsock32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_snmp.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "snmp - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_SNMP" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SNMP_EXPORTS" /D "COMPILE_DL_SNMP" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_SNMP=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts_debug.lib libsnmp.lib wsock32.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_snmp.dll" /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "snmp - Win32 Release_TS"
-# Name "snmp - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\snmp.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_snmp.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index d34587b85e..97191652d6 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -834,13 +834,10 @@ static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNo str = estrndup(Z_STRVAL_P(data), Z_STRLEN_P(data)); new_len = Z_STRLEN_P(data); } else { - zval tmp = *data; - - zval_copy_ctor(&tmp); - convert_to_string(&tmp); - str = estrndup(Z_STRVAL(tmp), Z_STRLEN(tmp)); - new_len = Z_STRLEN(tmp); - zval_dtor(&tmp); + zend_string *tmp = zval_get_string(data); + str = estrndup(tmp->val, tmp->len); + new_len = tmp->len; + zend_string_release(tmp); } if (SOAP_GLOBAL(encoding) != NULL) { @@ -953,9 +950,7 @@ static xmlNodePtr to_xml_hexbin(encodeTypePtr type, zval *data, int style, xmlNo FIND_ZVAL_NULL(data, ret, style); if (Z_TYPE_P(data) != IS_STRING) { - tmp = *data; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); + ZVAL_STR(&tmp, zval_get_string(data)); data = &tmp; } str = (unsigned char *) safe_emalloc(Z_STRLEN_P(data) * 2, sizeof(char), 1); @@ -1063,9 +1058,9 @@ static xmlNodePtr to_xml_long(encodeTypePtr type, zval *data, int style, xmlNode snprintf(s, sizeof(s), "%0.0F",floor(Z_DVAL_P(data))); xmlNodeSetContent(ret, BAD_CAST(s)); } else { - zval tmp = *data; + zval tmp; - zval_copy_ctor(&tmp); + ZVAL_DUP(&tmp, data); if (Z_TYPE(tmp) != IS_LONG) { convert_to_long(&tmp); } @@ -1090,11 +1085,7 @@ static xmlNodePtr to_xml_double(encodeTypePtr type, zval *data, int style, xmlNo xmlAddChild(parent, ret); FIND_ZVAL_NULL(data, ret, style); - tmp = *data; - if (Z_TYPE(tmp) != IS_DOUBLE) { - zval_copy_ctor(&tmp); - convert_to_double(&tmp); - } + ZVAL_DOUBLE(&tmp, zval_get_double(data)); str = (char *) safe_emalloc(EG(precision), 1, MAX_LENGTH_OF_DOUBLE + 1); php_gcvt(Z_DVAL(tmp), EG(precision), '.', 'E', str); @@ -1203,7 +1194,8 @@ static zval* get_zval_property(zval* object, char* name, zval *rv TSRMLS_DC) property_info = zend_get_property_info(Z_OBJCE_P(object), Z_STR(member), 1 TSRMLS_CC); EG(scope) = old_scope; - if (property_info && zend_hash_exists(Z_OBJPROP_P(object), property_info->name)) { + if (property_info != ZEND_WRONG_PROPERTY_INFO && property_info && + zend_hash_exists(Z_OBJPROP_P(object), property_info->name)) { zval_ptr_dtor(&member); return data; } @@ -3031,13 +3023,12 @@ static xmlNodePtr to_xml_list(encodeTypePtr enc, zval *data, int style, xmlNodeP xmlNodeSetContentLen(ret, BAD_CAST(list.s->val), list.s->len); smart_str_free(&list); } else { - zval tmp = *data; + zval tmp; char *str, *start, *next; smart_str list = {0}; if (Z_TYPE_P(data) != IS_STRING) { - zval_copy_ctor(&tmp); - convert_to_string(&tmp); + ZVAL_STR(&tmp, zval_get_string(data)); data = &tmp; } str = estrndup(Z_STRVAL_P(data), Z_STRLEN_P(data)); @@ -3143,10 +3134,9 @@ static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodeP if (Z_TYPE_P(data) == IS_STRING) { ret = xmlNewTextLen(BAD_CAST(Z_STRVAL_P(data)), Z_STRLEN_P(data)); } else { - zval tmp = *data; + zval tmp; - zval_copy_ctor(&tmp); - convert_to_string(&tmp); + ZVAL_STR(&tmp, zval_get_string(data)); ret = xmlNewTextLen(BAD_CAST(Z_STRVAL(tmp)), Z_STRLEN(tmp)); zval_dtor(&tmp); } diff --git a/ext/soap/php_soap.dsp b/ext/soap/php_soap.dsp deleted file mode 100644 index f07cba636e..0000000000 --- a/ext/soap/php_soap.dsp +++ /dev/null @@ -1,156 +0,0 @@ -# Microsoft Developer Studio Project File - Name="php_soap" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=php_soap - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "php_soap.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "php_soap.mak" CFG="php_soap - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "php_soap - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "php_soap - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "php_soap - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_SOAP_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\libxml2-2.4.12\include" /I "..\..\bind" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_SOAP_EXPORTSWS" /D "PHP_SOAP_EXPORTS" /D "ZEND_WIN32" /D "PHP_WIN32" /D "ZTS" /D ZEND_DEBUG=0 /D "COMPILE_DL_SOAP" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib libxml2.lib wsock32.lib resolv.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS\php_soap.dll" /libpath:"..\..\\" /libpath:"..\..\..\libxml2-2.4.12\lib" /libpath:"..\..\Release_TS"
-
-!ELSEIF "$(CFG)" == "php_soap - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP_SOAP_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /I "..\..\..\libxml2-2.4.12\include" /I "..\..\bind" /D "WS" /D "_MBCS" /D "_USRDLL" /D "PHP_SOAP_EXPORTS" /D "WIN32" /D "ZEND_WIN32" /D "PHP_WIN32" /D "ZTS" /D ZEND_DEBUG=1 /D "COMPILE_DL_SOAP" /FR"Debug_TS/" /Fp"Debug_TS/soap.pch" /YX /Fo"Debug_TS/" /Fd"Debug_TS/" /FD /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts_debug.lib libxml2.lib wsock32.lib resolv.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS\php_soap.dll" /pdbtype:sept /libpath:"..\..\\" /libpath:"..\..\..\libxml2-2.4.12\lib" /libpath:"..\..\Debug_TS"
-# SUBTRACT LINK32 /pdb:none /incremental:no
-
-!ENDIF
-
-# Begin Target
-
-# Name "php_soap - Win32 Release_TS"
-# Name "php_soap - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\php_encoding.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_http.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_packet_soap.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_schema.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_sdl.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_xml.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\soap.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_encoding.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_http.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_packet_soap.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_schema.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_sdl.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_soap.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_xml.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 2b7566525d..2b37622a7a 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -78,7 +78,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const int _old_soap_version = SOAP_GLOBAL(soap_version);\ SOAP_GLOBAL(use_soap_error_handler) = 1;\ SOAP_GLOBAL(error_code) = "Server";\ - Z_OBJ(SOAP_GLOBAL(error_object)) = Z_OBJ(EG(This)); + Z_OBJ(SOAP_GLOBAL(error_object)) = Z_OBJ(EX(This)); #define SOAP_SERVER_END_CODE() \ SOAP_GLOBAL(use_soap_error_handler) = _old_handler;\ @@ -93,11 +93,11 @@ static void soap_error_handler(int error_num, const char *error_filename, const int _old_soap_version = SOAP_GLOBAL(soap_version);\ zend_bool _old_in_compilation = CG(in_compilation); \ zend_execute_data *_old_current_execute_data = EG(current_execute_data); \ - zval *_old_stack_top = EG(argument_stack)->top; \ + zval *_old_stack_top = EG(vm_stack_top); \ int _bailout = 0;\ SOAP_GLOBAL(use_soap_error_handler) = 1;\ SOAP_GLOBAL(error_code) = "Client";\ - Z_OBJ(SOAP_GLOBAL(error_object)) = Z_OBJ(EG(This));\ + Z_OBJ(SOAP_GLOBAL(error_object)) = Z_OBJ(EX(This));\ zend_try { #define SOAP_CLIENT_END_CODE() \ @@ -105,18 +105,19 @@ 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(zend_get_class_entry(EG(exception) TSRMLS_CC), soap_fault_class_entry TSRMLS_CC)) {\ + !instanceof_function(EG(exception)->ce, soap_fault_class_entry TSRMLS_CC)) {\ _bailout = 1;\ }\ - if (_old_stack_top != EG(argument_stack)->top) { \ - while (EG(argument_stack)->prev != NULL && \ - ((char*)_old_stack_top < (char*)EG(argument_stack) || \ - (char*) _old_stack_top > (char*)EG(argument_stack)->end)) { \ - zend_vm_stack tmp = EG(argument_stack)->prev; \ - efree(EG(argument_stack)); \ - EG(argument_stack) = tmp; \ + if (_old_stack_top != EG(vm_stack_top)) { \ + while (EG(vm_stack)->prev != NULL && \ + ((char*)_old_stack_top < (char*)EG(vm_stack) || \ + (char*) _old_stack_top > (char*)EG(vm_stack)->end)) { \ + zend_vm_stack tmp = EG(vm_stack)->prev; \ + efree(EG(vm_stack)); \ + EG(vm_stack) = tmp; \ + EG(vm_stack_end) = tmp->end; \ } \ - EG(argument_stack)->top = _old_stack_top; \ + EG(vm_stack)->top = _old_stack_top; \ } \ } zend_end_try();\ SOAP_GLOBAL(use_soap_error_handler) = _old_handler;\ @@ -946,7 +947,7 @@ PHP_METHOD(SoapFault, __toString) fci.function_table = &Z_OBJCE_P(getThis())->function_table; ZVAL_STRINGL(&fci.function_name, "gettraceasstring", sizeof("gettraceasstring")-1); fci.symbol_table = NULL; - fci.object = Z_OBJ(EG(This)); + fci.object = Z_OBJ(EX(This)); fci.retval = &trace; fci.param_count = 0; fci.params = NULL; @@ -2621,7 +2622,8 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act return ret; } -static void do_soap_call(zval* this_ptr, +static void do_soap_call(zend_execute_data *execute_data, + zval* this_ptr, char* function, size_t function_len, int arg_count, @@ -2936,7 +2938,7 @@ PHP_METHOD(SoapClient, __call) if (output_headers) { array_init(output_headers); } - do_soap_call(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 TSRMLS_CC); if (arg_count > 0) { efree(real_args); } diff --git a/ext/sockets/sockets.dsp b/ext/sockets/sockets.dsp deleted file mode 100644 index 954f7a5d7e..0000000000 --- a/ext/sockets/sockets.dsp +++ /dev/null @@ -1,117 +0,0 @@ -# Microsoft Developer Studio Project File - Name="sockets" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=sockets - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "sockets.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "sockets.mak" CFG="sockets - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "sockets - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "sockets - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "sockets - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SOCKETS_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\bindlib_w32" /D "WIN32" /D "PHP_EXPORTS" /D "COMPILE_DL_SOCKETS" /D ZTS=1 /D HAVE_SOCKETS=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php7ts.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_sockets.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-# SUBTRACT LINK32 /debug
-
-!ELSEIF "$(CFG)" == "sockets - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SOCKETS_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\bindlib_w32" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_SOCKETS" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_SOCKETS=1 /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php7ts_debug.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_sockets.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "sockets - Win32 Release_TS"
-# Name "sockets - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\php_sockets_win.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\sockets.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_sockets.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\php_sockets_win.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index d38da10e65..aa740c40e2 100644 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -255,7 +255,7 @@ static int spl_autoload(zend_string *class_name, zend_string *lc_name, const cha zval result; int ret; - class_file_len = spprintf(&class_file, 0, "%s%.*s", lc_name->val, ext_len, ext); + class_file_len = (int)spprintf(&class_file, 0, "%s%.*s", lc_name->val, ext_len, ext); #if DEFAULT_SLASH != '\\' { @@ -320,7 +320,7 @@ PHP_FUNCTION(spl_autoload) pos_len = sizeof(SPL_DEFAULT_FILE_EXTENSIONS) - 1; } else { pos = file_exts->val; - pos_len = file_exts->len; + pos_len = (int)file_exts->len; } lc_name = zend_string_alloc(class_name->len, 0); @@ -328,7 +328,7 @@ PHP_FUNCTION(spl_autoload) while (pos && *pos && !EG(exception)) { pos1 = strchr(pos, ','); if (pos1) { - pos1_len = pos1 - pos; + pos1_len = (int)(pos1 - pos); } else { pos1_len = pos_len; } @@ -346,12 +346,14 @@ PHP_FUNCTION(spl_autoload) * The "scope" is determined by an opcode, if it is ZEND_FETCH_CLASS we know function was called indirectly by * the Zend engine. */ - zend_execute_data *ex = EG(current_execute_data); + zend_execute_data *ex = EX(prev_execute_data); while (ex && (!ex->func || !ZEND_USER_CODE(ex->func->type))) { ex = ex->prev_execute_data; } - if (ex && ex->opline->opcode != ZEND_FETCH_CLASS) { + 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); } else { php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s could not be loaded", class_name->val); @@ -757,7 +759,7 @@ PHPAPI zend_string *php_spl_object_hash(zval *obj TSRMLS_DC) /* {{{*/ if (!SPL_G(hash_mask_init)) { if (!BG(mt_rand_is_seeded)) { - php_mt_srand(GENERATE_SEED() TSRMLS_CC); + php_mt_srand((uint32_t)GENERATE_SEED() TSRMLS_CC); } SPL_G(hash_mask_handle) = (intptr_t)(php_mt_rand(TSRMLS_C) >> 1); diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 211180a08d..8aab4c49bf 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -1144,7 +1144,7 @@ static void spl_array_it_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ static void spl_array_set_array(zval *object, spl_array_object *intern, zval *array, zend_long ar_flags, int just_array TSRMLS_DC) { if (Z_TYPE_P(array) == IS_ARRAY) { - SEPARATE_ZVAL_IF_NOT_REF(array); + SEPARATE_ARRAY(array); } if (Z_TYPE_P(array) == IS_OBJECT && (Z_OBJ_HT_P(array) == &spl_handler_ArrayObject || Z_OBJ_HT_P(array) == &spl_handler_ArrayIterator)) { diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 1d9c00db0a..108eafddc4 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -199,7 +199,7 @@ static inline void spl_filesystem_object_get_file_name(spl_filesystem_object *in php_error_docref(NULL TSRMLS_CC, E_ERROR, "Object not initialized"); break; case SPL_FS_DIR: - intern->file_name_len = spprintf(&intern->file_name, 0, "%s%c%s", + intern->file_name_len = (int)spprintf(&intern->file_name, 0, "%s%c%s", spl_filesystem_object_get_path(intern, NULL TSRMLS_CC), slash, intern->u.dir.entry.d_name); break; @@ -233,7 +233,7 @@ static void spl_filesystem_dir_open(spl_filesystem_object* intern, char *path TS int skip_dots = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_SKIPDOTS); intern->type = SPL_FS_DIR; - intern->_path_len = strlen(path); + intern->_path_len = (int)strlen(path); intern->u.dir.dirp = php_stream_opendir(path, REPORT_ERRORS, FG(default_context)); if (intern->_path_len > 1 && IS_SLASH_AT(path, intern->_path_len-1)) { @@ -384,7 +384,7 @@ void spl_filesystem_info_set_filename(spl_filesystem_object *intern, char *path, } intern->file_name = use_copy ? estrndup(path, len) : path; - intern->file_name_len = len; + intern->file_name_len = (int)len; while (intern->file_name_len > 1 && IS_SLASH_AT(intern->file_name, intern->file_name_len-1)) { intern->file_name[intern->file_name_len-1] = 0; @@ -398,7 +398,7 @@ void spl_filesystem_info_set_filename(spl_filesystem_object *intern, char *path, p2 = 0; #endif if (p1 || p2) { - intern->_path_len = (p1 > p2 ? p1 : p2) - intern->file_name; + intern->_path_len = (int)((p1 > p2 ? p1 : p2) - intern->file_name); } else { intern->_path_len = 0; } @@ -821,12 +821,12 @@ SPL_METHOD(DirectoryIterator, seek) if (intern->u.dir.index > pos) { /* we first rewind */ - zend_call_method_with_0_params(&EG(This), Z_OBJCE(EG(This)), &intern->u.dir.func_rewind, "rewind", NULL); + zend_call_method_with_0_params(&EX(This), Z_OBJCE(EX(This)), &intern->u.dir.func_rewind, "rewind", NULL); } while (intern->u.dir.index < pos) { int valid = 0; - zend_call_method_with_0_params(&EG(This), Z_OBJCE(EG(This)), &intern->u.dir.func_valid, "valid", &retval); + 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); zval_ptr_dtor(&retval); @@ -834,7 +834,7 @@ SPL_METHOD(DirectoryIterator, seek) if (!valid) { break; } - zend_call_method_with_0_params(&EG(This), Z_OBJCE(EG(This)), &intern->u.dir.func_next, "next", NULL); + zend_call_method_with_0_params(&EX(This), Z_OBJCE(EX(This)), &intern->u.dir.func_next, "next", NULL); } } /* }}} */ @@ -934,7 +934,8 @@ SPL_METHOD(SplFileInfo, getExtension) p = zend_memrchr(ret->val, '.', ret->len); if (p) { - idx = p - ret->val; + assert(p > ret->val); + idx = (int)(p - ret->val); RETVAL_STRINGL(ret->val + idx + 1, ret->len - idx - 1); zend_string_release(ret); return; @@ -962,7 +963,8 @@ SPL_METHOD(DirectoryIterator, getExtension) p = zend_memrchr(fname->val, '.', fname->len); if (p) { - idx = p - fname->val; + assert(p > fname->val); + idx = (int)(p - fname->val); RETVAL_STRINGL(fname->val + idx + 1, fname->len - idx - 1); zend_string_release(fname); } else { @@ -1389,7 +1391,7 @@ SPL_METHOD(SplFileInfo, getPathInfo) if (path) { char *dpath = estrndup(path, path_len); path_len = php_dirname(dpath, path_len); - spl_filesystem_object_create_info(intern, dpath, path_len, 1, ce, return_value TSRMLS_CC); + spl_filesystem_object_create_info(intern, dpath, (int)path_len, 1, ce, return_value TSRMLS_CC); efree(dpath); } } @@ -1516,9 +1518,9 @@ SPL_METHOD(RecursiveDirectoryIterator, getChildren) subdir = Z_SPLFILESYSTEM_P(return_value); if (subdir) { if (intern->u.dir.sub_path && intern->u.dir.sub_path[0]) { - subdir->u.dir.sub_path_len = spprintf(&subdir->u.dir.sub_path, 0, "%s%c%s", intern->u.dir.sub_path, slash, intern->u.dir.entry.d_name); + subdir->u.dir.sub_path_len = (int)spprintf(&subdir->u.dir.sub_path, 0, "%s%c%s", intern->u.dir.sub_path, slash, intern->u.dir.entry.d_name); } else { - subdir->u.dir.sub_path_len = strlen(intern->u.dir.entry.d_name); + subdir->u.dir.sub_path_len = (int)strlen(intern->u.dir.entry.d_name); subdir->u.dir.sub_path = estrndup(intern->u.dir.entry.d_name, subdir->u.dir.sub_path_len); } subdir->info_class = intern->info_class; @@ -1553,7 +1555,7 @@ SPL_METHOD(RecursiveDirectoryIterator, getSubPathname) { spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis()); char *sub_name; - int len; + size_t len; char slash = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_UNIXPATHS) ? '/' : DEFAULT_SLASH; if (zend_parse_parameters_none() == FAILURE) { @@ -2170,7 +2172,8 @@ 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)) { return spl_filesystem_file_read_csv(intern, intern->u.file.delimiter, intern->u.file.enclosure, intern->u.file.escape, NULL TSRMLS_CC); } else { - zend_call_method_with_0_params(this_ptr, Z_OBJCE_P(getThis()), &intern->u.file.func_getCurr, "getCurrentLine", &retval); + 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); } if (!Z_ISUNDEF(retval)) { if (intern->u.file.current_line || !Z_ISUNDEF(intern->u.file.current_zval)) { @@ -2302,7 +2305,7 @@ SPL_METHOD(SplFileObject, __construct) p2 = 0; #endif if (p1 || p2) { - intern->_path_len = (p1 > p2 ? p1 : p2) - tmp_path; + intern->_path_len = (int)((p1 > p2 ? p1 : p2) - tmp_path); } else { intern->_path_len = 0; } @@ -2626,7 +2629,7 @@ SPL_METHOD(SplFileObject, fputcsv) char delimiter = intern->u.file.delimiter, enclosure = intern->u.file.enclosure, escape = intern->u.file.escape; char *delim = NULL, *enclo = NULL; size_t d_len = 0, e_len = 0; - int ret; + zend_long ret; zval *fields = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|ss", &fields, &delim, &d_len, &enclo, &e_len) == SUCCESS) { @@ -2775,7 +2778,7 @@ SPL_METHOD(SplFileObject, fseek) } spl_filesystem_file_free_line(intern TSRMLS_CC); - RETURN_LONG(php_stream_seek(intern->u.file.stream, pos, whence)); + RETURN_LONG(php_stream_seek(intern->u.file.stream, pos, (int)whence)); } /* }}} */ /* {{{ proto int SplFileObject::fgetc() diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c index 0a6f97c563..8a61407589 100644 --- a/ext/spl/spl_dllist.c +++ b/ext/spl/spl_dllist.c @@ -86,7 +86,6 @@ struct _spl_dllist_object { spl_ptr_llist *llist; int traverse_position; spl_ptr_llist_element *traverse_pointer; - zval retval; int flags; zend_function *fptr_offset_get; zend_function *fptr_offset_set; @@ -358,7 +357,6 @@ static void spl_dllist_object_free_storage(zend_object *object TSRMLS_DC) /* {{{ spl_ptr_llist_destroy(intern->llist TSRMLS_CC); SPL_LLIST_CHECK_DELREF(intern->traverse_pointer); - zval_ptr_dtor(&intern->retval); if (intern->debug_info != NULL) { zend_hash_destroy(intern->debug_info); @@ -482,10 +480,8 @@ static int spl_dllist_object_count_elements(zval *object, zend_long *count TSRML zval rv; zend_call_method_with_0_params(object, intern->std.ce, &intern->fptr_count, "count", &rv); if (!Z_ISUNDEF(rv)) { - zval_ptr_dtor(&intern->retval); - ZVAL_ZVAL(&intern->retval, &rv, 0, 0); - convert_to_long(&intern->retval); - *count = (zend_long) Z_LVAL(intern->retval); + *count = zval_get_long(&rv); + zval_ptr_dtor(&rv); return SUCCESS; } *count = 0; @@ -1186,7 +1182,7 @@ SPL_METHOD(SplDoublyLinkedList, unserialize) goto error; } - intern->flags = Z_LVAL(flags); + intern->flags = (int)Z_LVAL(flags); zval_ptr_dtor(&flags); /* elements */ diff --git a/ext/spl/spl_engine.h b/ext/spl/spl_engine.h index a621355ba4..8fa5539ba5 100644 --- a/ext/spl/spl_engine.h +++ b/ext/spl/spl_engine.h @@ -51,6 +51,36 @@ static inline int spl_instantiate_arg_ex2(zend_class_entry *pce, zval *retval, z } /* }}} */ +/* {{{ spl_instantiate_arg_n */ +static inline void spl_instantiate_arg_n(zend_class_entry *pce, zval *retval, int argc, zval *argv TSRMLS_DC) +{ + zend_function *func = pce->constructor; + zend_fcall_info fci; + zend_fcall_info_cache fcc; + zval dummy; + + spl_instantiate(pce, retval TSRMLS_CC); + + fci.size = sizeof(zend_fcall_info); + fci.function_table = &pce->function_table; + ZVAL_STR(&fci.function_name, func->common.function_name); + fci.object = Z_OBJ_P(retval); + fci.symbol_table = NULL; + fci.retval = &dummy; + fci.param_count = argc; + fci.params = argv; + fci.no_separation = 1; + + fcc.initialized = 1; + fcc.function_handler = func; + fcc.calling_scope = EG(scope); + fcc.called_scope = pce; + fcc.object = Z_OBJ_P(retval); + + zend_call_function(&fci, &fcc TSRMLS_CC); +} +/* }}} */ + #endif /* SPL_ENGINE_H */ /* diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c index ee5ef6b990..d63ac2e6e6 100644 --- a/ext/spl/spl_fixedarray.c +++ b/ext/spl/spl_fixedarray.c @@ -151,7 +151,7 @@ static HashTable* spl_fixedarray_object_get_gc(zval *obj, zval **table, int *n T if (intern->array) { *table = intern->array->elements; - *n = intern->array->size; + *n = (int)intern->array->size; } else { *table = NULL; *n = 0; @@ -165,10 +165,10 @@ static HashTable* spl_fixedarray_object_get_properties(zval *obj TSRMLS_DC) /* { { spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(obj); HashTable *ht = zend_std_get_properties(obj TSRMLS_CC); - int i = 0; + zend_long i = 0; if (intern->array) { - int j = zend_hash_num_elements(ht); + zend_long j = zend_hash_num_elements(ht); for (i = 0; i < intern->array->size; i++) { if (!Z_ISUNDEF(intern->array->elements[i])) { diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c index d29150c1d6..b421c03757 100644 --- a/ext/spl/spl_heap.c +++ b/ext/spl/spl_heap.c @@ -160,12 +160,12 @@ static int spl_ptr_heap_zval_max_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { /* exception or call failure */ return 0; } - return lval; + return lval > 0 ? 1 : (lval < 0 ? -1 : 0); } } compare_function(&result, a, b TSRMLS_CC); - return Z_LVAL(result); + return (int)Z_LVAL(result); } /* }}} */ @@ -184,12 +184,12 @@ static int spl_ptr_heap_zval_min_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { /* exception or call failure */ return 0; } - return lval; + return lval > 0 ? 1 : (lval < 0 ? -1 : 0); } } compare_function(&result, b, a TSRMLS_CC); - return Z_LVAL(result); + return (int)Z_LVAL(result); } /* }}} */ @@ -215,12 +215,12 @@ static int spl_ptr_pqueue_zval_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { / /* exception or call failure */ return 0; } - return lval; + return lval > 0 ? 1 : (lval < 0 ? -1 : 0); } } compare_function(&result, a_priority_p, b_priority_p TSRMLS_CC); - return Z_LVAL(result); + return (int)Z_LVAL(result); } /* }}} */ diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index dddc8c5e73..c129115eeb 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -540,7 +540,7 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla intern->iterators = emalloc(sizeof(spl_sub_iterator)); intern->level = 0; intern->mode = mode; - intern->flags = flags; + intern->flags = (int)flags; intern->max_depth = -1; intern->in_iteration = 0; intern->ce = Z_OBJCE_P(object); @@ -854,8 +854,11 @@ SPL_METHOD(RecursiveIteratorIterator, setMaxDepth) if (max_depth < -1) { zend_throw_exception(spl_ce_OutOfRangeException, "Parameter max_depth must be >= -1", 0 TSRMLS_CC); return; + } else if (max_depth > INT_MAX) { + max_depth = INT_MAX; } - object->max_depth = max_depth; + + object->max_depth = (int)max_depth; } /* }}} */ /* {{{ proto int|false RecursiveIteratorIterator::getMaxDepth() @@ -883,7 +886,7 @@ 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", zend_get_class_entry(*zobject TSRMLS_CC)->name->val); + php_error_docref(NULL TSRMLS_CC, E_ERROR, "The %s instance wasn't initialized properly", (*zobject)->ce->name->val); } zobj = &object->iterators[level].zobject; @@ -1423,9 +1426,9 @@ int spl_dual_it_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS) static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more TSRMLS_DC); -static inline int spl_cit_check_flags(int flags) +static inline int spl_cit_check_flags(zend_long flags) { - int cnt = 0; + zend_long cnt = 0; cnt += (flags & CIT_CALL_TOSTRING) ? 1 : 0; cnt += (flags & CIT_TOSTRING_USE_KEY) ? 1 : 0; @@ -2037,8 +2040,10 @@ SPL_METHOD(RegexIterator, accept) if (Z_TYPE(intern->current.data) == IS_UNDEF) { RETURN_FALSE; + } else if (Z_TYPE(intern->current.data) == IS_ARRAY) { + RETURN_FALSE; } - + if (intern->u.regex.flags & REGIT_USE_KEY) { subject_ptr = &intern->current.key; } else { @@ -2049,10 +2054,10 @@ SPL_METHOD(RegexIterator, accept) use_copy = zend_make_printable_zval(subject_ptr, &subject_copy TSRMLS_CC); if (use_copy) { subject = Z_STRVAL(subject_copy); - subject_len = Z_STRLEN(subject_copy); + subject_len = (int)Z_STRLEN(subject_copy); } else { subject = Z_STRVAL_P(subject_ptr); - subject_len = Z_STRLEN_P(subject_ptr); + subject_len = (int)Z_STRLEN_P(subject_ptr); } use_copy = 0; @@ -2074,8 +2079,7 @@ SPL_METHOD(RegexIterator, accept) 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); - count = zend_hash_num_elements(Z_ARRVAL(intern->current.data)); - RETVAL_BOOL(count > 0); + RETVAL_BOOL(Z_LVAL(zcount) > 0); break; case REGIT_MODE_SPLIT: @@ -2254,7 +2258,7 @@ SPL_METHOD(RecursiveRegexIterator, __construct) SPL_METHOD(RecursiveRegexIterator, getChildren) { spl_dual_it_object *intern; - zval retval, regex; + zval retval; if (zend_parse_parameters_none() == FAILURE) { return; @@ -2264,13 +2268,40 @@ SPL_METHOD(RecursiveRegexIterator, getChildren) zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &retval); if (!EG(exception)) { - ZVAL_STR_COPY(®ex, intern->u.regex.regex); - spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), return_value, &retval, ®ex TSRMLS_CC); - zval_ptr_dtor(®ex); + zval args[5]; + + ZVAL_COPY(&args[0], &retval); + ZVAL_STR_COPY(&args[1], intern->u.regex.regex); + ZVAL_LONG(&args[2], intern->u.regex.mode); + 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); + + zval_ptr_dtor(&args[1]); } zval_ptr_dtor(&retval); } /* }}} */ +SPL_METHOD(RecursiveRegexIterator, accept) +{ + spl_dual_it_object *intern; + + if (zend_parse_parameters_none() == FAILURE) { + return; + } + + SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis()); + + if (Z_TYPE(intern->current.data) == IS_UNDEF) { + RETURN_FALSE; + } else if (Z_TYPE(intern->current.data) == IS_ARRAY) { + RETURN_BOOL(zend_hash_num_elements(Z_ARRVAL(intern->current.data)) > 0); + } + + zend_call_method_with_0_params(getThis(), spl_ce_RegexIterator, NULL, "accept", return_value); +} + #endif /* {{{ spl_dual_it_dtor */ @@ -2456,6 +2487,7 @@ ZEND_END_ARG_INFO(); static const zend_function_entry spl_funcs_RecursiveRegexIterator[] = { SPL_ME(RecursiveRegexIterator, __construct, arginfo_rec_regex_it___construct, ZEND_ACC_PUBLIC) + SPL_ME(RecursiveRegexIterator, accept, arginfo_recursive_it_void, ZEND_ACC_PUBLIC) SPL_ME(RecursiveFilterIterator, hasChildren, arginfo_recursive_it_void, ZEND_ACC_PUBLIC) SPL_ME(RecursiveRegexIterator, getChildren, arginfo_recursive_it_void, ZEND_ACC_PUBLIC) PHP_FE_END diff --git a/ext/spl/spl_iterators.h b/ext/spl/spl_iterators.h index f0740275dc..76f0b45e57 100644 --- a/ext/spl/spl_iterators.h +++ b/ext/spl/spl_iterators.h @@ -134,7 +134,7 @@ typedef struct _spl_dual_it_object { struct { zval data; zval key; - int pos; + zend_long pos; } current; dual_it_type dit_type; union { diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c index d3ce72aaa3..f7f884df18 100644 --- a/ext/spl/spl_observer.c +++ b/ext/spl/spl_observer.c @@ -398,7 +398,7 @@ static int spl_object_storage_compare_info(zval *e1, zval *e2 TSRMLS_DC) /* {{{ return 1; } - return Z_LVAL(result); + return Z_LVAL(result) > 0 ? 1 : (Z_LVAL(result) < 0 ? -1 : 0); } /* }}} */ diff --git a/ext/spl/tests/bug68128.phpt b/ext/spl/tests/bug68128.phpt new file mode 100644 index 0000000000..ff41dd4931 --- /dev/null +++ b/ext/spl/tests/bug68128.phpt @@ -0,0 +1,91 @@ +--TEST-- +Bug #68128 - RecursiveRegexIterator raises "Array to string conversion" notice +--FILE-- +<?php + +$array = new ArrayIterator(array('a', array('b', 'c'))); +$regex = new RegexIterator($array, '/Array/'); + +foreach ($regex as $match) { + var_dump($match); +} + +$rArrayIterator = new RecursiveArrayIterator(array('test1', array('tet3', 'test4', 'test5'))); +$rRegexIterator = new RecursiveRegexIterator($rArrayIterator, '/^(t)est(\d*)/', + RecursiveRegexIterator::ALL_MATCHES, 0, PREG_PATTERN_ORDER); + +foreach ($rRegexIterator as $key1 => $value1) { + + if ($rRegexIterator->hasChildren()) { + + // print all children + echo "Children: "; + foreach ($rRegexIterator->getChildren() as $key => $value) { + print_r($value); + } + echo "\n"; + } else { + echo "No children "; + print_r($value1); + echo "\n"; + } +} + +?> +--EXPECT-- +No children Array +( + [0] => Array + ( + [0] => test1 + ) + + [1] => Array + ( + [0] => t + ) + + [2] => Array + ( + [0] => 1 + ) + +) + +Children: Array +( + [0] => Array + ( + [0] => test4 + ) + + [1] => Array + ( + [0] => t + ) + + [2] => Array + ( + [0] => 4 + ) + +) +Array +( + [0] => Array + ( + [0] => test5 + ) + + [1] => Array + ( + [0] => t + ) + + [2] => Array + ( + [0] => 5 + ) + +) + diff --git a/ext/spl/tests/iterator_048.phpt b/ext/spl/tests/iterator_048.phpt index bad4e7888a..64ca97f4d6 100644 --- a/ext/spl/tests/iterator_048.phpt +++ b/ext/spl/tests/iterator_048.phpt @@ -13,11 +13,6 @@ class MyRecursiveRegexIterator extends RecursiveRegexIterator var_dump($v); } } - - function accept() - { - return $this->hasChildren() || parent::accept(); - } } $ar = new RecursiveArrayIterator(array('Foo', array('Bar'), 'FooBar', array('Baz'), 'Biz')); diff --git a/ext/spl/tests/iterator_050.phpt b/ext/spl/tests/iterator_050.phpt index fed4a3b2ee..63d8fbfa9a 100644 --- a/ext/spl/tests/iterator_050.phpt +++ b/ext/spl/tests/iterator_050.phpt @@ -46,8 +46,6 @@ array(3) { [2]=> %s(1) "2" } - -Notice: Array to string conversion in %siterator_050.php on line %d int(0) array(2) { [0]=> @@ -69,8 +67,6 @@ array(2) { [1]=> %s(1) "1" } - -Notice: Array to string conversion in %siterator_050.php on line %d object(ArrayIterator)#%d (1) { %s"storage"%s"ArrayIterator":private]=> array(9) { diff --git a/ext/spl/tests/iterator_052.phpt b/ext/spl/tests/iterator_052.phpt index c68bd5234d..84b3eb993c 100644 --- a/ext/spl/tests/iterator_052.phpt +++ b/ext/spl/tests/iterator_052.phpt @@ -46,18 +46,6 @@ var_dump($ar); <?php exit(0); ?> --EXPECTF-- bool(true) -int(0) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) int(1) array(3) { @@ -97,85 +85,11 @@ array(3) { } } bool(true) -int(3) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) -int(4) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} - -Notice: Array to string conversion in %siterator_052.php on line %d +bool(false) bool(true) -int(5) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) -int(6) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) -int(7) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} -bool(true) -int(8) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) int(0) array(2) { @@ -231,67 +145,11 @@ array(2) { } } bool(true) -int(3) -array(2) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } -} -bool(true) -int(4) -array(2) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } -} - -Notice: Array to string conversion in %siterator_052.php on line %d bool(true) -int(5) -array(2) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } -} +bool(false) bool(true) -int(6) -array(2) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } -} bool(true) -int(7) -array(2) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } -} bool(true) -int(8) -array(2) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } -} object(ArrayIterator)#%d (1) { ["storage":"ArrayIterator":private]=> array(9) { diff --git a/ext/spl/tests/iterator_053.phpt b/ext/spl/tests/iterator_053.phpt index 5d9c740c31..b472523ab6 100644 --- a/ext/spl/tests/iterator_053.phpt +++ b/ext/spl/tests/iterator_053.phpt @@ -46,122 +46,14 @@ var_dump($ar); <?php exit(0); ?> --EXPECTF-- bool(true) -int(0) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) -int(1) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) -int(2) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} -bool(true) -int(3) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) -int(4) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) -int(5) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} +bool(false) bool(true) -int(6) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) -int(7) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) -int(8) -array(3) { - [0]=> - array(0) { - } - [1]=> - array(0) { - } - [2]=> - array(0) { - } -} bool(true) int(0) array(2) { @@ -232,20 +124,7 @@ array(2) { string(1) "4" } } -bool(true) -int(5) -array(2) { - [0]=> - array(1) { - [0]=> - string(1) "5" - } - [1]=> - array(1) { - [0]=> - string(1) "5" - } -} +bool(false) bool(true) int(6) array(2) { diff --git a/ext/spl/tests/iterator_054.phpt b/ext/spl/tests/iterator_054.phpt index 1f1cd580c1..91266c9571 100644 --- a/ext/spl/tests/iterator_054.phpt +++ b/ext/spl/tests/iterator_054.phpt @@ -42,8 +42,6 @@ array(3) { [2]=> string(1) "3" } - -Notice: Array to string conversion in %siterator_054.php on line %d int(7) array(2) { [0]=> diff --git a/ext/standard/array.c b/ext/standard/array.c index c8e79957b5..57d0065b25 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -331,7 +331,7 @@ PHP_FUNCTION(count) } #ifdef HAVE_SPL /* if not and the object implements Countable we call its count() method */ - if (Z_OBJ_HT_P(array)->get_class_entry && instanceof_function(Z_OBJCE_P(array), spl_ce_Countable TSRMLS_CC)) { + if (instanceof_function(Z_OBJCE_P(array), spl_ce_Countable TSRMLS_CC)) { zend_call_method_with_0_params(array, NULL, NULL, "count", &retval); if (Z_TYPE(retval) != IS_UNDEF) { RETVAL_LONG(zval_get_long(&retval)); @@ -728,7 +728,7 @@ static int php_array_user_key_compare(const void *a, const void *b TSRMLS_DC) /* zval_ptr_dtor(&args[0]); zval_ptr_dtor(&args[1]); - return result; + return result < 0 ? -1 : result > 0 ? 1 : 0; } /* }}} */ @@ -1301,9 +1301,10 @@ PHP_FUNCTION(array_search) } /* }}} */ -static int php_valid_var_name(char *var_name, int var_name_len) /* {{{ */ +static int php_valid_var_name(char *var_name, size_t var_name_len) /* {{{ */ { - int i, ch; + size_t i; + int ch; if (!var_name || !var_name_len) { return 0; @@ -1337,7 +1338,7 @@ static int php_valid_var_name(char *var_name, int var_name_len) /* {{{ */ } /* }}} */ -PHPAPI int php_prefix_varname(zval *result, zval *prefix, char *var_name, int 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 TSRMLS_DC) /* {{{ */ { 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)); @@ -1569,7 +1570,7 @@ PHP_FUNCTION(array_fill) } /* allocate an array for return */ - array_init_size(return_value, num); + array_init_size(return_value, (uint32_t)num); if (num == 0) { return; @@ -1786,10 +1787,10 @@ err: static void php_array_data_shuffle(zval *array TSRMLS_DC) /* {{{ */ { - uint idx; + uint32_t idx, j, n_elems; Bucket *p, temp; HashTable *hash; - int j, n_elems, rnd_idx, n_left; + zend_long rnd_idx, n_left; n_elems = zend_hash_num_elements(Z_ARRVAL_P(array)); @@ -1992,13 +1993,14 @@ PHP_FUNCTION(array_push) } /* }}} */ -/* {{{ void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end) */ -static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end) +/* {{{ proto mixed array_pop(array stack) + Pops an element off the end of the array */ +PHP_FUNCTION(array_pop) { zval *stack, /* Input stack */ *val; /* Value to be popped */ - zend_string *key = NULL; - zend_ulong index; + uint32_t idx; + Bucket *p; #ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &stack) == FAILURE) { @@ -2014,56 +2016,118 @@ static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end) return; } - /* Get the first or last value and copy it into the return value */ - if (off_the_end) { - zend_hash_internal_pointer_end(Z_ARRVAL_P(stack)); - while (1) { - val = zend_hash_get_current_data(Z_ARRVAL_P(stack)); - if (!val) { - return; - } else if (Z_TYPE_P(val) == IS_INDIRECT) { - val = Z_INDIRECT_P(val); - if (Z_TYPE_P(val) == IS_UNDEF) { - zend_hash_move_backwards(Z_ARRVAL_P(stack)); - continue; - } - } + /* Get the last value and copy it into the return value */ + idx = Z_ARRVAL_P(stack)->nNumUsed; + while (1) { + if (idx == 0) { + return; + } + idx--; + p = Z_ARRVAL_P(stack)->arData + idx; + val = &p->val; + if (Z_TYPE_P(val) == IS_INDIRECT) { + val = Z_INDIRECT_P(val); + } + if (Z_TYPE_P(val) != IS_UNDEF) { break; } + } + ZVAL_DEREF(val); + ZVAL_COPY(return_value, val); + + if (!p->key && Z_ARRVAL_P(stack)->nNextFreeElement > 0 && p->h >= (zend_ulong)(Z_ARRVAL_P(stack)->nNextFreeElement - 1)) { + Z_ARRVAL_P(stack)->nNextFreeElement = Z_ARRVAL_P(stack)->nNextFreeElement - 1; + } + + /* Delete the last value */ + if (p->key) { + if (Z_ARRVAL_P(stack) == &EG(symbol_table).ht) { + zend_delete_global_variable(p->key TSRMLS_CC); + } else { + zend_hash_del(Z_ARRVAL_P(stack), p->key); + } } else { - zend_hash_internal_pointer_reset(Z_ARRVAL_P(stack)); - while (1) { - val = zend_hash_get_current_data(Z_ARRVAL_P(stack)); - if (!val) { - return; - } else if (Z_TYPE_P(val) == IS_INDIRECT) { - val = Z_INDIRECT_P(val); - if (Z_TYPE_P(val) == IS_UNDEF) { - zend_hash_move_forward(Z_ARRVAL_P(stack)); - continue; - } - } + zend_hash_index_del(Z_ARRVAL_P(stack), p->h); + } + + zend_hash_internal_pointer_reset(Z_ARRVAL_P(stack)); +} +/* }}} */ + +/* {{{ proto mixed array_shift(array stack) + Pops an element off the beginning of the array */ +PHP_FUNCTION(array_shift) +{ + zval *stack, /* Input stack */ + *val; /* Value to be popped */ + uint32_t idx; + Bucket *p; + +#ifndef FAST_ZPP + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &stack) == FAILURE) { + return; + } +#else + ZEND_PARSE_PARAMETERS_START(1, 1) + Z_PARAM_ARRAY_EX(stack, 0, 1) + ZEND_PARSE_PARAMETERS_END(); +#endif + + if (zend_hash_num_elements(Z_ARRVAL_P(stack)) == 0) { + return; + } + + /* Get the first value and copy it into the return value */ + idx = 0; + while (1) { + if (idx == Z_ARRVAL_P(stack)->nNumUsed) { + return; + } + p = Z_ARRVAL_P(stack)->arData + idx; + val = &p->val; + if (Z_TYPE_P(val) == IS_INDIRECT) { + val = Z_INDIRECT_P(val); + } + if (Z_TYPE_P(val) != IS_UNDEF) { break; } + idx++; } - RETVAL_ZVAL_FAST(val); + ZVAL_DEREF(val); + ZVAL_COPY(return_value, val); - /* Delete the first or last value */ - zend_hash_get_current_key(Z_ARRVAL_P(stack), &key, &index, 0); - if (key && Z_ARRVAL_P(stack) == &EG(symbol_table).ht) { - zend_delete_global_variable(key TSRMLS_CC); - } else if (key) { - zend_hash_del(Z_ARRVAL_P(stack), key); + /* Delete the first value */ + if (p->key) { + if (Z_ARRVAL_P(stack) == &EG(symbol_table).ht) { + zend_delete_global_variable(p->key TSRMLS_CC); + } else { + zend_hash_del(Z_ARRVAL_P(stack), p->key); + } } else { - zend_hash_index_del(Z_ARRVAL_P(stack), index); + zend_hash_index_del(Z_ARRVAL_P(stack), p->h); } - /* If we did a shift... re-index like it did before */ - if (!off_the_end) { - unsigned int k = 0; + /* re-index like it did before */ + if (Z_ARRVAL_P(stack)->u.flags & HASH_FLAG_PACKED) { + uint32_t k = 0; + + for (idx = 0; idx < Z_ARRVAL_P(stack)->nNumUsed; idx++) { + p = Z_ARRVAL_P(stack)->arData + idx; + if (Z_TYPE(p->val) == IS_UNDEF) continue; + if (idx != k) { + Bucket *q = Z_ARRVAL_P(stack)->arData + k; + q->h = k; + q->key = NULL; + ZVAL_COPY_VALUE(&q->val, &p->val); + ZVAL_UNDEF(&p->val); + } + k++; + } + Z_ARRVAL_P(stack)->nNumUsed = k; + Z_ARRVAL_P(stack)->nNextFreeElement = k; + } else { + uint32_t k = 0; int should_rehash = 0; - uint idx; - Bucket *p; for (idx = 0; idx < Z_ARRVAL_P(stack)->nNumUsed; idx++) { p = Z_ARRVAL_P(stack)->arData + idx; @@ -2079,36 +2143,14 @@ static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end) } Z_ARRVAL_P(stack)->nNextFreeElement = k; if (should_rehash) { - if (Z_ARRVAL_P(stack)->u.flags & HASH_FLAG_PACKED) { - zend_hash_packed_to_hash(Z_ARRVAL_P(stack)); - } else { - zend_hash_rehash(Z_ARRVAL_P(stack)); - } + zend_hash_rehash(Z_ARRVAL_P(stack)); } - } else if (!key && Z_ARRVAL_P(stack)->nNextFreeElement > 0 && index >= (zend_ulong)(Z_ARRVAL_P(stack)->nNextFreeElement - 1)) { - Z_ARRVAL_P(stack)->nNextFreeElement = Z_ARRVAL_P(stack)->nNextFreeElement - 1; } zend_hash_internal_pointer_reset(Z_ARRVAL_P(stack)); } /* }}} */ -/* {{{ proto mixed array_pop(array stack) - Pops an element off the end of the array */ -PHP_FUNCTION(array_pop) -{ - _phpi_pop(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); -} -/* }}} */ - -/* {{{ proto mixed array_shift(array stack) - Pops an element off the beginning of the array */ -PHP_FUNCTION(array_shift) -{ - _phpi_pop(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); -} -/* }}} */ - /* {{{ proto int array_unshift(array stack, mixed var [, mixed ...]) Pushes elements onto the beginning of the array */ PHP_FUNCTION(array_unshift) @@ -2181,7 +2223,7 @@ PHP_FUNCTION(array_splice) /* Don't create the array of removed elements if it's not going * to be used; e.g. only removing and/or replacing elements */ if (USED_RET()) { - int size = length; + zend_long size = length; /* Clamp the offset.. */ if (offset > num_in) { @@ -2193,17 +2235,17 @@ PHP_FUNCTION(array_splice) /* ..and the length */ if (length < 0) { size = num_in - offset + length; - } else if (((zend_ulong) offset + (zend_ulong) length) > (unsigned) num_in) { + } else if (((zend_ulong) offset + (zend_ulong) length) > (uint32_t) num_in) { size = num_in - offset; } /* Initialize return value */ - array_init_size(return_value, size > 0 ? size : 0); + array_init_size(return_value, size > 0 ? (uint32_t)size : 0); rem_hash = Z_ARRVAL_P(return_value); } /* Perform splice */ - new_hash = php_splice(Z_ARRVAL_P(array), offset, length, repl, repl_num, rem_hash); + new_hash = php_splice(Z_ARRVAL_P(array), (int)offset, (int)length, repl, (int)repl_num, rem_hash); /* Replace input array's hashtable with the new one */ old_hash = *Z_ARRVAL_P(array); @@ -2273,7 +2315,7 @@ PHP_FUNCTION(array_slice) } /* Initialize returned array */ - array_init_size(return_value, length > 0 ? length : 0); + array_init_size(return_value, length > 0 ? (uint32_t)length : 0); if (length <= 0) { return; @@ -2597,7 +2639,7 @@ PHP_FUNCTION(array_keys) add_key = 1; /* Go through input array and add keys to the return array */ - ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(input), num_idx, str_idx, entry) { + 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); add_key = zval_is_true(&res); @@ -2856,9 +2898,9 @@ PHP_FUNCTION(array_pad) /* Pad on the right or on the left */ if (pad_size > 0) { - new_hash = php_splice(Z_ARRVAL_P(return_value), input_size, 0, pads, num_pads, NULL); + new_hash = php_splice(Z_ARRVAL_P(return_value), (int)input_size, 0, pads, (int)num_pads, NULL); } else { - new_hash = php_splice(Z_ARRVAL_P(return_value), 0, 0, pads, num_pads, NULL); + new_hash = php_splice(Z_ARRVAL_P(return_value), 0, 0, pads, (int)num_pads, NULL); } /* Copy the result hash into return value */ @@ -3930,22 +3972,23 @@ PHPAPI int php_multisort_compare(const void *a, const void *b TSRMLS_DC) /* {{{ Bucket *ab = *(Bucket **)a; Bucket *bb = *(Bucket **)b; int r; - int result = 0; + zend_long result; zval temp; r = 0; do { + php_set_compare_func(ARRAYG(multisort_flags)[MULTISORT_TYPE][r] TSRMLS_CC); ARRAYG(compare_func)(&temp, &ab[r].val, &bb[r].val TSRMLS_CC); result = ARRAYG(multisort_flags)[MULTISORT_ORDER][r] * Z_LVAL(temp); if (result != 0) { - return result; + return result > 0 ? 1 : -1; } r++; } while (Z_TYPE(ab[r].val) != IS_UNDEF); - return result; + return 0; } /* }}} */ @@ -4036,7 +4079,7 @@ PHP_FUNCTION(array_multisort) /* flag allowed here */ if (parse_state[MULTISORT_TYPE] == 1) { /* Save the flag and make sure then next arg is not the current flag. */ - sort_type = Z_LVAL(args[i]); + 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); @@ -4164,7 +4207,7 @@ PHP_FUNCTION(array_rand) /* Make the return value an array only if we need to pass back more than one result. */ if (num_req > 1) { - array_init_size(return_value, num_req); + array_init_size(return_value, (uint32_t)num_req); } /* We can't use zend_hash_index_find() because the array may have string keys or gaps. */ @@ -4649,14 +4692,14 @@ PHP_FUNCTION(array_chunk) size = num_in > 0 ? num_in : 1; } - array_init_size(return_value, ((num_in - 1) / size) + 1); + array_init_size(return_value, (uint32_t)(((num_in - 1) / size) + 1)); ZVAL_UNDEF(&chunk); ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(input), num_key, str_key, entry) { /* If new chunk, create and initialize it. */ if (Z_TYPE(chunk) == IS_UNDEF) { - array_init_size(&chunk, size); + array_init_size(&chunk, (uint32_t)size); } /* Add entry to the chunk, preserving keys if necessary. */ diff --git a/ext/standard/assert.c b/ext/standard/assert.c index 65472170e2..fa5ccfc12f 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -25,12 +25,12 @@ /* }}} */ ZEND_BEGIN_MODULE_GLOBALS(assert) - zend_long active; - zend_long bail; - zend_long warning; - zend_long quiet_eval; zval callback; char *cb; + zend_bool active; + zend_bool bail; + zend_bool warning; + zend_bool quiet_eval; ZEND_END_MODULE_GLOBALS(assert) ZEND_DECLARE_MODULE_GLOBALS(assert) @@ -78,11 +78,11 @@ static PHP_INI_MH(OnChangeCallback) /* {{{ */ /* }}} */ PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("assert.active", "1", PHP_INI_ALL, OnUpdateLong, active, zend_assert_globals, assert_globals) - STD_PHP_INI_ENTRY("assert.bail", "0", PHP_INI_ALL, OnUpdateLong, bail, zend_assert_globals, assert_globals) - STD_PHP_INI_ENTRY("assert.warning", "1", PHP_INI_ALL, OnUpdateLong, warning, zend_assert_globals, assert_globals) + STD_PHP_INI_ENTRY("assert.active", "1", PHP_INI_ALL, OnUpdateBool, active, zend_assert_globals, assert_globals) + STD_PHP_INI_ENTRY("assert.bail", "0", PHP_INI_ALL, OnUpdateBool, bail, zend_assert_globals, assert_globals) + STD_PHP_INI_ENTRY("assert.warning", "1", PHP_INI_ALL, OnUpdateBool, warning, zend_assert_globals, assert_globals) PHP_INI_ENTRY("assert.callback", NULL, PHP_INI_ALL, OnChangeCallback) - STD_PHP_INI_ENTRY("assert.quiet_eval", "0", PHP_INI_ALL, OnUpdateLong, quiet_eval, zend_assert_globals, assert_globals) + 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) /* {{{ */ @@ -258,7 +258,7 @@ PHP_FUNCTION(assert_options) { zval *value = NULL; zend_long what; - int oldint; + zend_bool oldint; int ac = ZEND_NUM_ARGS(); zend_string *key; diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 36611b812b..a168069cfb 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -3952,7 +3952,7 @@ PHP_FUNCTION(long2ip) /* "It's a long but it's not, PHP ints are signed */ char *ip; size_t ip_len; - zend_ulong n; + uint32_t n; struct in_addr myaddr; #ifdef HAVE_INET_PTON char str[40]; @@ -4076,7 +4076,7 @@ PHP_FUNCTION(putenv) #endif } - pe.key_len = strlen(pe.key); + pe.key_len = (int)strlen(pe.key); #ifdef PHP_WIN32 if (equals) { if (pe.key_len < setting_len - 1) { @@ -4289,7 +4289,7 @@ PHP_FUNCTION(getopt) opts->need_param = 0; opts->opt_name = estrdup(arg_str->val); - len = strlen(opts->opt_name); + len = (int)strlen(opts->opt_name); if ((len > 0) && (opts->opt_name[len - 1] == ':')) { opts->need_param++; opts->opt_name[len - 1] = '\0'; @@ -4345,7 +4345,7 @@ PHP_FUNCTION(getopt) } /* Add this option / argument pair to the result hash. */ - optname_len = strlen(optname); + optname_len = (int)strlen(optname); if (!(optname_len > 1 && optname[0] == '0') && is_numeric_string(optname, optname_len, NULL, NULL, 0) == IS_LONG) { /* numeric string */ int optname_int = atoi(optname); @@ -4400,9 +4400,9 @@ PHP_FUNCTION(sleep) RETURN_FALSE; } #ifdef PHP_SLEEP_NON_VOID - RETURN_LONG(php_sleep(num)); + RETURN_LONG(php_sleep((unsigned int)num)); #else - php_sleep(num); + php_sleep((unsigned int)num); #endif } @@ -4422,7 +4422,7 @@ PHP_FUNCTION(usleep) php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of microseconds must be greater than or equal to 0"); RETURN_FALSE; } - usleep(num); + usleep((unsigned int)num); #endif } /* }}} */ @@ -4449,7 +4449,7 @@ PHP_FUNCTION(time_nanosleep) } php_req.tv_sec = (time_t) tv_sec; - php_req.tv_nsec = tv_nsec; + php_req.tv_nsec = (long)tv_nsec; if (!nanosleep(&php_req, &php_rem)) { RETURN_TRUE; } else if (errno == EINTR) { @@ -4554,7 +4554,7 @@ PHP_FUNCTION(get_cfg_var) return; } - retval = cfg_get_entry(varname, varname_len); + retval = cfg_get_entry(varname, (uint)varname_len); if (retval) { if (Z_TYPE_P(retval) == IS_ARRAY) { @@ -4637,7 +4637,7 @@ PHP_FUNCTION(error_log) } if (argc > 1) { - opt_err = erropt; + opt_err = (int)erropt; } if (_php_error_log_ex(opt_err, message, message_len, opt, headers TSRMLS_CC) == FAILURE) { @@ -4655,7 +4655,7 @@ PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers T } /* }}} */ -PHPAPI int _php_error_log_ex(int opt_err, char *message, int 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 TSRMLS_DC) /* {{{ */ { php_stream *stream = NULL; @@ -4786,15 +4786,15 @@ PHP_FUNCTION(forward_static_call) return; } - if (!EG(current_execute_data)->prev_execute_data->func->common.scope) { + if (!EX(prev_execute_data)->func->common.scope) { zend_error(E_ERROR, "Cannot call forward_static_call() when no class scope is active"); } fci.retval = &retval; - if (EG(current_execute_data)->called_scope && - instanceof_function(EG(current_execute_data)->called_scope, fci_cache.calling_scope TSRMLS_CC)) { - fci_cache.called_scope = EG(current_execute_data)->called_scope; + if (EX(called_scope) && + instanceof_function(EX(called_scope), fci_cache.calling_scope TSRMLS_CC)) { + fci_cache.called_scope = EX(called_scope); } if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { @@ -4818,9 +4818,9 @@ PHP_FUNCTION(forward_static_call_array) zend_fcall_info_args(&fci, params TSRMLS_CC); fci.retval = &retval; - if (EG(current_execute_data)->called_scope && - instanceof_function(EG(current_execute_data)->called_scope, fci_cache.calling_scope TSRMLS_CC)) { - fci_cache.called_scope = EG(current_execute_data)->called_scope; + if (EX(called_scope) && + instanceof_function(EX(called_scope), fci_cache.calling_scope TSRMLS_CC)) { + fci_cache.called_scope = EX(called_scope); } if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { @@ -4962,7 +4962,7 @@ static int user_tick_function_compare(user_tick_function_entry * tick_fe1, user_ } /* }}} */ -void php_call_shutdown_functions(TSRMLS_D) /* {{{ */ +PHPAPI void php_call_shutdown_functions(TSRMLS_D) /* {{{ */ { if (BG(user_shutdown_function_names)) { zend_try { @@ -4974,7 +4974,7 @@ void php_call_shutdown_functions(TSRMLS_D) /* {{{ */ } /* }}} */ -void php_free_shutdown_functions(TSRMLS_D) /* {{{ */ +PHPAPI void php_free_shutdown_functions(TSRMLS_D) /* {{{ */ { if (BG(user_shutdown_function_names)) zend_try { @@ -5126,7 +5126,7 @@ PHP_FUNCTION(php_strip_whitespace) char *filename; size_t filename_len; zend_lex_state original_lex_state; - zend_file_handle file_handle = {0}; + zend_file_handle file_handle = {{0}}; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { RETURN_FALSE; @@ -5212,7 +5212,7 @@ PHP_FUNCTION(ini_get) return; } - str = zend_ini_string(varname, varname_len, 0); + str = zend_ini_string(varname, (uint)varname_len, 0); if (!str) { RETURN_FALSE; @@ -5322,7 +5322,7 @@ PHP_FUNCTION(ini_set) return; } - old_value = zend_ini_string(varname->val, varname->len, 0); + old_value = zend_ini_string(varname->val, (int)varname->len, 0); /* copy to return here, because alter might free it! */ if (old_value) { @@ -5331,7 +5331,7 @@ PHP_FUNCTION(ini_set) RETVAL_FALSE; } -#define _CHECK_PATH(var, var_len, ini) php_ini_check_path(var, var_len, ini, sizeof(ini)) +#define _CHECK_PATH(var, var_len, ini) php_ini_check_path(var, (int)var_len, ini, sizeof(ini)) /* open basedir check */ if (PG(open_basedir)) { if (_CHECK_PATH(varname->val, varname->len, "error_log") || @@ -5592,7 +5592,7 @@ PHP_FUNCTION(getprotobynumber) return; } - ent = getprotobynumber(proto); + ent = getprotobynumber((int)proto); if (ent == NULL) { RETURN_FALSE; @@ -5790,7 +5790,7 @@ static void php_simple_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int cal } if (!(Z_STRLEN_P(arg1) > 1 && Z_STRVAL_P(arg1)[0] == '0') && is_numeric_string(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1), NULL, NULL, 0) == IS_LONG) { - zend_ulong key = (zend_ulong) zend_atol(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1)); + zend_ulong key = (zend_ulong) zend_atol(Z_STRVAL_P(arg1), (int)Z_STRLEN_P(arg1)); if ((find_hash = zend_hash_index_find(Z_ARRVAL_P(arr), key)) == NULL) { array_init(&hash); find_hash = zend_hash_index_update(Z_ARRVAL_P(arr), key, &hash); @@ -5878,7 +5878,7 @@ PHP_FUNCTION(parse_ini_file) fh.type = ZEND_HANDLE_FILENAME; array_init(return_value); - if (zend_parse_ini_file(&fh, 0, 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 TSRMLS_CC) == FAILURE) { zval_dtor(return_value); RETURN_FALSE; } @@ -5917,7 +5917,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, 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 TSRMLS_CC) == FAILURE) { zval_dtor(return_value); RETVAL_FALSE; } diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h index 1b0325caa8..ee0e025c5d 100644 --- a/ext/standard/basic_functions.h +++ b/ext/standard/basic_functions.h @@ -142,8 +142,8 @@ 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, int message_len, char *opt, char *headers TSRMLS_DC); -PHPAPI int php_prefix_varname(zval *result, zval *prefix, char *var_name, int var_name_len, zend_bool add_underscore 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); #if SIZEOF_INT == 4 /* Most 32-bit and 64-bit systems have 32-bit ints */ @@ -204,11 +204,11 @@ typedef struct _php_basic_globals { zend_class_entry *incomplete_class; unsigned serialize_lock; /* whether to use the locally supplied var_hash instead (__sleep/__wakeup) */ struct { - void *var_hash; + struct php_serialize_data *data; unsigned level; } serialize; struct { - void *var_hash; + struct php_unserialize_data *data; unsigned level; } unserialize; @@ -259,4 +259,8 @@ PHPAPI extern zend_bool register_user_shutdown_function(char *function_name, siz 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 void php_call_shutdown_functions(TSRMLS_D); +PHPAPI void php_free_shutdown_functions(TSRMLS_D); + + #endif /* BASIC_FUNCTIONS_H */ diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index a591a67d44..a76fb136a3 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -221,7 +221,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) /* {{{ */ { - zend_file_handle fh = {0}; + zend_file_handle fh = {{0}}; if (filename == NULL || filename[0] == '\0') { return FAILURE; @@ -379,15 +379,13 @@ static int browser_reg_compare(zval *browser TSRMLS_DC, int num_args, va_list ar number of characters changed in the user agent being checked versus the previous match found and the current match. */ if (Z_TYPE_P(found_browser_entry) == IS_ARRAY) { - int i, prev_len = 0, curr_len = 0, ua_len; - zval *current_match; + size_t i, prev_len = 0, curr_len = 0; + zval *current_match = zend_hash_str_find(Z_ARRVAL_P(browser), "browser_name_pattern", sizeof("browser_name_pattern")-1); - if ((current_match = zend_hash_str_find(Z_ARRVAL_P(browser), "browser_name_pattern", sizeof("browser_name_pattern")-1)) == NULL) { + if (!current_match) { return 0; } - ua_len = lookup_browser_length; - for (i = 0; i < Z_STRLEN_P(previous_match); i++) { switch (Z_STRVAL_P(previous_match)[i]) { case '?': diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index 9599e2f056..7fae04fcbf 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -295,7 +295,7 @@ PHP_FUNCTION(crypt) } salt[salt_in_len] = '\0'; - if ((result = php_crypt(str, str_len, salt, salt_in_len)) == NULL) { + if ((result = php_crypt(str, (int)str_len, salt, (int)salt_in_len)) == NULL) { if (salt[0] == '*' && salt[1] == '0') { RETURN_STRING("*1"); } else { diff --git a/ext/standard/crypt_sha256.c b/ext/standard/crypt_sha256.c index 5f28bd7b9f..d79d14510a 100644 --- a/ext/standard/crypt_sha256.c +++ b/ext/standard/crypt_sha256.c @@ -120,7 +120,7 @@ static void sha256_process_block (const void *buffer, size_t len, struct sha256_ /* First increment the byte count. FIPS 180-2 specifies the possible length of the file up to 2^64 bits. Here we only compute the number of bytes. Do a double word increment. */ - ctx->total[0] += len; + ctx->total[0] += (uint32_t)len; if (ctx->total[0] < len) { ++ctx->total[1]; } @@ -261,7 +261,7 @@ static void sha256_process_bytes(const void *buffer, size_t len, struct sha256_c size_t add = 128 - left_over > len ? len : 128 - left_over; memcpy(&ctx->buffer[left_over], buffer, add); - ctx->buflen += add; + ctx->buflen += (uint32_t)add; if (ctx->buflen > 64) { sha256_process_block(ctx->buffer, ctx->buflen & ~63, ctx); @@ -306,7 +306,7 @@ compilers don't. */ left_over -= 64; memcpy(ctx->buffer, &ctx->buffer[64], left_over); } - ctx->buflen = left_over; + ctx->buflen = (uint32_t)left_over; } } @@ -529,7 +529,7 @@ char * php_sha256_crypt_r(const char *key, const char *salt, char *buffer, int b } cp = __php_stpncpy(cp, salt, MIN ((size_t) MAX (0, buflen), salt_len)); - buflen -= MIN((size_t) MAX (0, buflen), salt_len); + buflen -= MIN(MAX (0, buflen), (int)salt_len); if (buflen > 0) { *cp++ = '$'; @@ -600,7 +600,7 @@ char * php_sha256_crypt(const char *key, const char *salt) static int buflen; int needed = (sizeof(sha256_salt_prefix) - 1 + sizeof(sha256_rounds_prefix) + 9 + 1 - + strlen(salt) + 1 + 43 + 1); + + (int)strlen(salt) + 1 + 43 + 1); if (buflen < needed) { char *new_buffer = (char *) realloc(buffer, needed); diff --git a/ext/standard/cyr_convert.c b/ext/standard/cyr_convert.c index ea5cc19387..1718b75729 100644 --- a/ext/standard/cyr_convert.c +++ b/ext/standard/cyr_convert.c @@ -201,11 +201,11 @@ _cyr_mac = { * d - x-cp866 * m - x-mac-cyrillic *****************************************************************************/ -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, size_t length, char from, char to TSRMLS_DC) { const unsigned char *from_table, *to_table; unsigned char tmp; - int i; + size_t i; from_table = NULL; to_table = NULL; @@ -258,8 +258,7 @@ static char * php_convert_cyr_string(unsigned char *str, int length, char from, if (!str) return (char *)str; - for( i = 0; i<length; i++) - { + for (i = 0; i < length; i++) { tmp = (from_table == NULL)? str[i] : from_table[ str[i] ]; str[i] = (to_table == NULL) ? tmp : to_table[tmp + 256]; } @@ -281,7 +280,7 @@ PHP_FUNCTION(convert_cyr_string) str = zend_string_init(input, input_len, 0); - php_convert_cyr_string(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] TSRMLS_CC); RETVAL_NEW_STR(str); } /* }}} */ diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 7b4ab1cd3e..a822ac4da0 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -87,7 +87,7 @@ static zend_class_entry *dir_class_entry_ptr; } \ ZEND_FETCH_RESOURCE(dirp, php_stream *, tmp, -1, "Directory", php_file_le_stream()); \ } else { \ - ZEND_FETCH_RESOURCE(dirp, php_stream *, 0, DIRG(default_dir)->handle, "Directory", php_file_le_stream()); \ + 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()); \ @@ -463,7 +463,7 @@ PHP_FUNCTION(glob) cwd[2] = '\0'; } #endif - cwd_skip = strlen(cwd)+1; + cwd_skip = (int)strlen(cwd)+1; snprintf(work_pattern, MAXPATHLEN, "%s%c%s", cwd, DEFAULT_SLASH, pattern); pattern = work_pattern; diff --git a/ext/standard/dl.c b/ext/standard/dl.c index 6ea69e5b81..a9ca94c0ad 100644 --- a/ext/standard/dl.c +++ b/ext/standard/dl.c @@ -129,7 +129,7 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC) } libpath = estrdup(filename); } else if (extension_dir && extension_dir[0]) { - int extension_dir_len = strlen(extension_dir); + int extension_dir_len = (int)strlen(extension_dir); if (IS_SLASH(extension_dir[extension_dir_len-1])) { spprintf(&libpath, 0, "%s%s", extension_dir, filename); /* SAFE */ diff --git a/ext/standard/dns.c b/ext/standard/dns.c index a000ad9638..13a1ab75df 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -535,7 +535,7 @@ static u_char *php_parserr(u_char *cp, u_char *end, querybuf *answer, int type_t } if (n) { memcpy(tp->val + l2 , cp + l1 + 1, n); - add_next_index_stringl(&entries, cp + l1 + 1, n); + add_next_index_stringl(&entries, (char *) cp + l1 + 1, n); } l1 = l1 + n + 1; l2 = l2 + n; diff --git a/ext/standard/dns_win32.c b/ext/standard/dns_win32.c index 865ad30b3e..963d1f7a54 100644 --- a/ext/standard/dns_win32.c +++ b/ext/standard/dns_win32.c @@ -208,7 +208,7 @@ static void php_parserr(PDNS_RECORD pRec, int type_to_fetch, int store, int raw, DWORD count = data_txt->dwStringCount; zend_string *txt; char *txt_dst; - long txt_len = 0; + size_t txt_len = 0; zval entries; add_assoc_string(subarray, "type", "TXT"); @@ -222,7 +222,7 @@ static void php_parserr(PDNS_RECORD pRec, int type_to_fetch, int store, int raw, txt = zend_string_safe_alloc(txt_len, 2, 0, 0); txt_dst = txt->val; for (i = 0; i < count; i++) { - int len = strlen(data_txt->pStringArray[i]); + size_t len = strlen(data_txt->pStringArray[i]); memcpy(txt_dst, data_txt->pStringArray[i], len); add_next_index_stringl(&entries, data_txt->pStringArray[i], len); txt_dst += len; diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 28f01b338f..6106fe2c86 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -61,7 +61,8 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_ { FILE *fp; char *buf; - int l = 0, pclose_return; + size_t l = 0; + int pclose_return; char *b, *d=NULL; php_stream *stream; size_t buflen, bufl = 0; @@ -115,8 +116,8 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_ } else if (type == 2) { /* strip trailing whitespaces */ l = bufl; - while (l-- && isspace(((unsigned char *)buf)[l])); - if (l != (int)(bufl - 1)) { + while (l >= 1 && l-- && isspace(((unsigned char *)buf)[l])); + if (l != (bufl - 1)) { bufl = l + 1; buf[bufl] = '\0'; } @@ -128,8 +129,8 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_ /* strip trailing whitespaces if we have not done so already */ if ((type == 2 && buf != b) || type != 2) { l = bufl; - while (l-- && isspace(((unsigned char *)buf)[l])); - if (l != (int)(bufl - 1)) { + while (l >= 1 && l-- && isspace(((unsigned char *)buf)[l])); + if (l != (bufl - 1)) { bufl = l + 1; buf[bufl] = '\0'; } @@ -240,7 +241,7 @@ PHP_FUNCTION(passthru) */ PHPAPI zend_string *php_escape_shell_cmd(char *str) { - register int x, y, l = strlen(str); + register int x, y, l = (int)strlen(str); char *p = NULL; size_t estimate = (2 * l) + 1; zend_string *cmd; @@ -333,7 +334,7 @@ PHPAPI zend_string *php_escape_shell_cmd(char *str) */ PHPAPI zend_string *php_escape_shell_arg(char *str) { - int x, y = 0, l = strlen(str); + int x, y = 0, l = (int)strlen(str); zend_string *cmd; size_t estimate = (4 * l) + 3; diff --git a/ext/standard/file.c b/ext/standard/file.c index 446da20fb3..ff7c5433eb 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1098,7 +1098,7 @@ PHPAPI PHP_FUNCTION(fgetss) php_stream *stream; zend_string *allowed = NULL; char *allowed_tags=NULL; - int allowed_tags_len=0; + size_t allowed_tags_len=0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|lS", &fd, &bytes, &allowed) == FAILURE) { RETURN_FALSE; @@ -1196,8 +1196,8 @@ PHPAPI PHP_FUNCTION(fwrite) zval *arg1; char *arg2; size_t arg2len; - int ret; - int num_bytes; + size_t ret; + size_t num_bytes; zend_long arg3 = 0; char *buffer = NULL; php_stream *stream; @@ -1309,7 +1309,7 @@ PHPAPI PHP_FUNCTION(fseek) PHP_STREAM_TO_ZVAL(stream, arg1); - RETURN_LONG(php_stream_seek(stream, arg2, whence)); + RETURN_LONG(php_stream_seek(stream, arg2, (int)whence)); } /* }}} */ @@ -1355,7 +1355,7 @@ PHP_FUNCTION(mkdir) context = php_stream_context_from_zval(zcontext, 0); - RETURN_BOOL(php_stream_mkdir(dir, mode, (recursive ? PHP_STREAM_MKDIR_RECURSIVE : 0) | REPORT_ERRORS, context)); + RETURN_BOOL(php_stream_mkdir(dir, (int)mode, (recursive ? PHP_STREAM_MKDIR_RECURSIVE : 0) | REPORT_ERRORS, context)); } /* }}} */ @@ -1384,7 +1384,7 @@ PHP_FUNCTION(readfile) { char *filename; size_t filename_len; - int size = 0; + size_t size = 0; zend_bool use_include_path = 0; zval *zcontext = NULL; php_stream *stream; @@ -1427,7 +1427,7 @@ PHP_FUNCTION(umask) if (ZEND_NUM_ARGS() == 0) { umask(oldumask); } else { - umask(arg1); + umask((int)arg1); } RETURN_LONG(oldumask); @@ -1439,7 +1439,7 @@ PHP_FUNCTION(umask) PHPAPI PHP_FUNCTION(fpassthru) { zval *arg1; - int size; + size_t size; php_stream *stream; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) { @@ -1852,7 +1852,7 @@ PHP_FUNCTION(fputcsv) char escape_char = '\\'; /* allow this to be set as parameter */ php_stream *stream; zval *fp = NULL, *fields = NULL; - int ret; + size_t ret; char *delimiter_str = NULL, *enclosure_str = NULL, *escape_str = NULL; size_t delimiter_str_len = 0, enclosure_str_len = 0, escape_str_len = 0; @@ -1908,7 +1908,8 @@ PHP_FUNCTION(fputcsv) /* {{{ 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) { - int count, i = 0, ret; + int count, i = 0; + size_t ret; zval *field_tmp; smart_str csvline = {0}; @@ -2486,7 +2487,7 @@ PHP_FUNCTION(fnmatch) RETURN_FALSE; } - RETURN_BOOL( ! fnmatch( pattern, filename, flags )); + RETURN_BOOL( ! fnmatch( pattern, filename, (int)flags )); } /* }}} */ #endif diff --git a/ext/standard/file.h b/ext/standard/file.h index fdace75d3b..ec60b86e99 100644 --- a/ext/standard/file.h +++ b/ext/standard/file.h @@ -23,6 +23,8 @@ #ifndef FILE_H #define FILE_H +#include "php_network.h" + PHP_MINIT_FUNCTION(file); PHP_MSHUTDOWN_FUNCTION(file); @@ -73,7 +75,7 @@ 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(int socketd, int block TSRMLS_DC); +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); diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 6a06a55d94..53aede1469 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -835,7 +835,7 @@ PHP_FUNCTION(clearstatcache) return; } - php_clear_stat_cache(clear_realpath_cache, filename, filename_len TSRMLS_CC); + php_clear_stat_cache(clear_realpath_cache, filename, (int)filename_len TSRMLS_CC); } /* }}} */ diff --git a/ext/standard/filters.c b/ext/standard/filters.c index f0f49950bb..3fd27afa43 100644 --- a/ext/standard/filters.c +++ b/ext/standard/filters.c @@ -176,14 +176,14 @@ typedef struct _php_strip_tags_filter { int persistent; } php_strip_tags_filter; -static int php_strip_tags_filter_ctor(php_strip_tags_filter *inst, const char *allowed_tags, int allowed_tags_len, int persistent) +static int php_strip_tags_filter_ctor(php_strip_tags_filter *inst, const char *allowed_tags, size_t allowed_tags_len, int persistent) { if (allowed_tags != NULL) { if (NULL == (inst->allowed_tags = pemalloc(allowed_tags_len, persistent))) { return FAILURE; } memcpy((char *)inst->allowed_tags, allowed_tags, allowed_tags_len); - inst->allowed_tags_len = allowed_tags_len; + inst->allowed_tags_len = (int)allowed_tags_len; } else { inst->allowed_tags = NULL; } @@ -861,7 +861,8 @@ static php_conv_err_t php_conv_qprint_encode_convert(php_conv_qprint_encode *ins /* Check to see if this is EOL whitespace. */ if (inst->lbchars != NULL) { unsigned char *ps2; - unsigned int j, lb_cnt2; + unsigned int lb_cnt2; + size_t j; lb_cnt2 = 0; ps2 = ps; @@ -1265,7 +1266,7 @@ static php_conv_err_t php_conv_get_ulong_prop_ex(const HashTable *ht, zend_ulong zval tmp; if (Z_TYPE_P(tmpval) != IS_LONG) { - ZVAL_DUP(&tmp, tmpval);; + ZVAL_DUP(&tmp, tmpval); convert_to_long(&tmp); tmpval = &tmp; } @@ -1318,6 +1319,7 @@ static int php_conv_get_int_prop_ex(const HashTable *ht, int *pretval, char *fie } #endif +/* XXX this might need an additional fix so it uses size_t, whereby unsigned is quite big so leaving as is for now */ static int php_conv_get_uint_prop_ex(const HashTable *ht, unsigned int *pretval, char *field_name, size_t field_name_len) { zend_ulong l; @@ -1326,7 +1328,7 @@ static int php_conv_get_uint_prop_ex(const HashTable *ht, unsigned int *pretval, *pretval = 0; if ((err = php_conv_get_ulong_prop_ex(ht, &l, field_name, field_name_len)) == PHP_CONV_ERR_SUCCESS) { - *pretval = l; + *pretval = (unsigned int)l; } return err; } @@ -1931,12 +1933,12 @@ typedef struct _php_chunked_filter_data { int persistent; } php_chunked_filter_data; -static int php_dechunk(char *buf, int len, php_chunked_filter_data *data) +static size_t php_dechunk(char *buf, size_t len, php_chunked_filter_data *data) { char *p = buf; char *end = p + len; char *out = buf; - int out_len = 0; + size_t out_len = 0; while (p < end) { switch (data->state) { diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index 4574667c94..f84075440b 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -376,9 +376,9 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC) char *format, padding; zend_string *result; int always_sign; - int format_len; + size_t format_len; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) { + if (zend_parse_parameters(param_count TSRMLS_CC, "+", &args, &argc) == FAILURE) { return NULL; } diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c index 090d3f8f32..30a6fda5d6 100644 --- a/ext/standard/fsock.c +++ b/ext/standard/fsock.c @@ -35,14 +35,18 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent) size_t host_len; zend_long port = -1; zval *zerrno = NULL, *zerrstr = NULL; - double timeout = FG(default_socket_timeout); - zend_ulong conv; + double timeout = (double)FG(default_socket_timeout); +#ifndef PHP_WIN32 + time_t conv; +#else + long conv; +#endif struct timeval tv; char *hashkey = NULL; php_stream *stream = NULL; int err; char *hostname = NULL; - zend_long hostname_len; + size_t hostname_len; zend_string *errstr = NULL; RETVAL_FALSE; @@ -63,8 +67,13 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent) } /* prepare the timeout value for use */ - conv = (unsigned long) (timeout * 1000000.0); +#ifndef PHP_WIN32 + conv = (time_t) (timeout * 1000000.0); tv.tv_sec = conv / 1000000; +#else + conv = (long) (timeout * 1000000.0); + tv.tv_sec = conv / 1000000; +#endif tv.tv_usec = conv % 1000000; if (zerrno) { diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index 2bf4e02a41..ed93345bac 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -155,7 +155,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char if (resource->port == 0) resource->port = 21; - transport_len = spprintf(&transport, 0, "tcp://%s:%d", resource->host, resource->port); + transport_len = (int)spprintf(&transport, 0, "tcp://%s:%d", resource->host, resource->port); stream = php_stream_xport_create(transport, transport_len, REPORT_ERRORS, STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, NULL, NULL, context, NULL, NULL); efree(transport); if (stream == NULL) { @@ -245,7 +245,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char /* send the user name */ if (resource->user != NULL) { - tmp_len = php_raw_url_decode(resource->user, strlen(resource->user)); + tmp_len = (int)php_raw_url_decode(resource->user, (int)strlen(resource->user)); PHP_FTP_CNTRL_CHK(resource->user, tmp_len, "Invalid login %s") @@ -262,7 +262,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char php_stream_notify_info(context, PHP_STREAM_NOTIFY_AUTH_REQUIRED, tmp_line, 0); if (resource->pass != NULL) { - tmp_len = php_raw_url_decode(resource->pass, strlen(resource->pass)); + tmp_len = (int)php_raw_url_decode(resource->pass, (int)strlen(resource->pass)); PHP_FTP_CNTRL_CHK(resource->pass, tmp_len, "Invalid password %s") @@ -424,8 +424,8 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa php_stream *reuseid=NULL; size_t file_size = 0; zval *tmpzval; - int allow_overwrite = 0; - int read_write = 0; + zend_bool allow_overwrite = 0; + int8_t read_write = 0; char *transport; int transport_len; @@ -498,7 +498,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa } else if (read_write == 2) { /* when writing file (but not appending), it must NOT exist, unless a context option exists which allows it */ if (context && (tmpzval = php_stream_context_get_option(context, "ftp", "overwrite")) != NULL) { - allow_overwrite = Z_LVAL_P(tmpzval); + allow_overwrite = Z_LVAL_P(tmpzval) ? 1 : 0; } if (result <= 299 && result >= 200) { if (allow_overwrite) { @@ -554,7 +554,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa if (hoststart == NULL) { hoststart = resource->host; } - transport_len = spprintf(&transport, 0, "tcp://%s:%d", hoststart, portno); + transport_len = (int)spprintf(&transport, 0, "tcp://%s:%d", hoststart, portno); datastream = php_stream_xport_create(transport, transport_len, REPORT_ERRORS, STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, NULL, NULL, context, NULL, NULL); efree(transport); if (datastream == NULL) { @@ -855,7 +855,7 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url, gmt->tm_isdst = -1; /* apply the GMT offset */ - tm.tm_sec += stamp - mktime(gmt); + tm.tm_sec += (long)(stamp - mktime(gmt)); tm.tm_isdst = gmt->tm_isdst; ssb->sb.st_mtime = mktime(&tm); diff --git a/ext/standard/head.c b/ext/standard/head.c index 3dd18ee0fd..1417b52bc0 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -73,10 +73,10 @@ PHPAPI int php_header(TSRMLS_D) } -PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, time_t expires, char *path, int path_len, char *domain, int 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 TSRMLS_DC) { char *cookie; - int len=sizeof("Set-Cookie: "); + size_t len=sizeof("Set-Cookie: "); zend_string *dt; sapi_header_line ctr = {0}; int result; @@ -164,7 +164,7 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t } ctr.line = cookie; - ctr.line_len = strlen(cookie); + ctr.line_len = (uint)strlen(cookie); result = sapi_header_op(SAPI_HEADER_ADD, &ctr TSRMLS_CC); efree(cookie); @@ -300,7 +300,7 @@ PHP_FUNCTION(http_response_code) zend_long old_response_code; old_response_code = SG(sapi_headers).http_response_code; - SG(sapi_headers).http_response_code = response_code; + SG(sapi_headers).http_response_code = (int)response_code; if (old_response_code) { RETURN_LONG(old_response_code); diff --git a/ext/standard/head.h b/ext/standard/head.h index e32810a6f3..850a71dc74 100644 --- a/ext/standard/head.h +++ b/ext/standard/head.h @@ -38,6 +38,6 @@ PHP_FUNCTION(headers_list); PHP_FUNCTION(http_response_code); PHPAPI int php_header(TSRMLS_D); -PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, time_t expires, char *path, int path_len, char *domain, int 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 TSRMLS_DC); #endif diff --git a/ext/standard/html.c b/ext/standard/html.c index dfe30d9b3e..516bcc4ef7 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -377,7 +377,7 @@ static enum entity_charset determine_charset(char *charset_hint TSRMLS_DC) { int i; enum entity_charset charset = cs_utf_8; - int len = 0; + size_t len = 0; const zend_encoding *zenc; /* Default is now UTF-8 */ @@ -1513,7 +1513,7 @@ PHP_FUNCTION(htmlspecialchars_decode) return; } - replaced = php_unescape_html_entities((unsigned char*)str, str_len, 0 /*!all*/, quote_style, NULL TSRMLS_CC); + replaced = php_unescape_html_entities((unsigned char*)str, str_len, 0 /*!all*/, (int)quote_style, NULL TSRMLS_CC); if (replaced) { RETURN_STR(replaced); } @@ -1547,7 +1547,7 @@ PHP_FUNCTION(html_entity_decode) if (!hint_charset) { default_charset = get_default_charset(TSRMLS_C); } - replaced = php_unescape_html_entities((unsigned char*)str->val, str->len, 1 /*all*/, 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) TSRMLS_CC); if (replaced) { RETURN_STR(replaced); @@ -1649,7 +1649,7 @@ PHP_FUNCTION(get_html_translation_table) array_init(return_value); - entity_table = determine_entity_table(all, doctype); + entity_table = determine_entity_table((int)all, doctype); if (all && !CHARSET_UNICODE_COMPAT(charset)) { to_uni_table = enc_to_uni_index[charset]; } diff --git a/ext/standard/http.c b/ext/standard/http.c index 9174163b7d..e5ba87d870 100644 --- a/ext/standard/http.c +++ b/ext/standard/http.c @@ -26,9 +26,9 @@ /* {{{ php_url_encode_hash */ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, - const char *num_prefix, int num_prefix_len, - const char *key_prefix, int key_prefix_len, - const char *key_suffix, int key_suffix_len, + 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) { zend_string *key = NULL; @@ -107,7 +107,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, *p = '\0'; } else { char *ekey; - int ekey_len; + size_t ekey_len; /* Is an integer key */ ekey_len = spprintf(&ekey, 0, "%pd", idx); newprefix_len = key_prefix_len + num_prefix_len + ekey_len + key_suffix_len + 3 /* %5B */; @@ -194,7 +194,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, case IS_DOUBLE: { char *ekey; - int ekey_len; + size_t ekey_len; ekey_len = spprintf(&ekey, 0, "%.*G", (int) EG(precision), Z_DVAL_P(zdata)); smart_str_appendl(formstr, ekey, ekey_len); efree(ekey); @@ -242,7 +242,7 @@ PHP_FUNCTION(http_build_query) 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, 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 TSRMLS_CC) == 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 27c6cf6248..e1f8653c8d 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -121,7 +121,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *tmp = NULL; char *ua_str = NULL; zval *ua_zval = NULL, *tmpzval = NULL, ssl_proxy_peer_name; - int scratch_len = 0; + size_t scratch_len = 0; int body = 0; char location[HTTP_HEADER_BLOCK_SIZE]; zval *response_header = NULL; @@ -132,14 +132,16 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, int eol_detect = 0; char *transport_string; zend_string *errstr = NULL; - int transport_len, have_header = 0, request_fulluri = 0, ignore_errors = 0; + size_t transport_len; + int have_header = 0; + zend_bool request_fulluri = 0, ignore_errors = 0; char *protocol_version = NULL; int protocol_version_len = 3; /* Default: "1.0" */ struct timeval timeout; char *user_headers = NULL; int header_init = ((flags & HTTP_WRAPPER_HEADER_INIT) != 0); int redirected = ((flags & HTTP_WRAPPER_REDIRECTED) != 0); - int follow_location = 1; + zend_bool follow_location = 1; php_stream_filter *transfer_encoding = NULL; int response_code; zend_array *symbol_table; @@ -201,10 +203,19 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, if (context && (tmpzval = php_stream_context_get_option(context, wrapper->wops->label, "timeout")) != NULL) { double d = zval_get_double(tmpzval); +#ifndef PHP_WIN32 timeout.tv_sec = (time_t) d; timeout.tv_usec = (size_t) ((d - timeout.tv_sec) * 1000000); +#else + timeout.tv_sec = (long) d; + timeout.tv_usec = (long) ((d - timeout.tv_sec) * 1000000); +#endif } else { +#ifndef PHP_WIN32 timeout.tv_sec = FG(default_socket_timeout); +#else + timeout.tv_sec = (long)FG(default_socket_timeout); +#endif timeout.tv_usec = 0; } @@ -346,7 +357,7 @@ finish: php_stream_notify_info(context, PHP_STREAM_NOTIFY_CONNECT, NULL, 0); if (header_init && context && (tmpzval = php_stream_context_get_option(context, "http", "max_redirects")) != NULL) { - redirect_max = zval_get_long(tmpzval); + redirect_max = (int)zval_get_long(tmpzval); } if (context && (tmpzval = php_stream_context_get_option(context, "http", "method")) != NULL) { @@ -366,7 +377,7 @@ finish: } if (context && (tmpzval = php_stream_context_get_option(context, "http", "protocol_version")) != NULL) { - protocol_version_len = spprintf(&protocol_version, 0, "%.1F", zval_get_double(tmpzval)); + protocol_version_len = (int)spprintf(&protocol_version, 0, "%.1F", zval_get_double(tmpzval)); } if (!scratch) { @@ -378,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) ? 1 : 0; + request_fulluri = zend_is_true(tmpzval TSRMLS_CC); } if (request_fulluri) { @@ -731,7 +742,7 @@ finish: if (!strncasecmp(http_header_line, "Location: ", 10)) { if (context && (tmpzval = php_stream_context_get_option(context, "http", "follow_location")) != NULL) { - follow_location = zval_get_long(tmpzval); + follow_location = zval_is_true(tmpzval); } else if (!(response_code >= 300 && response_code < 304 || 307 == response_code || 308 == response_code)) { /* we shouldn't redirect automatically if follow_location isn't set and response_code not in (300, 301, 302, 303 and 307) @@ -843,7 +854,7 @@ finish: #define CHECK_FOR_CNTRL_CHARS(val) { \ if (val) { \ unsigned char *s, *e; \ - int l; \ + size_t l; \ l = php_url_decode(val, strlen(val)); \ s = (unsigned char*)val; e = s + l; \ while (s < e) { \ @@ -891,7 +902,7 @@ out: /* Restore original chunk size now that we're done with headers */ if (options & STREAM_WILL_CAST) - php_stream_set_chunk_size(stream, chunk_size); + php_stream_set_chunk_size(stream, (int)chunk_size); /* restore the users auto-detect-line-endings setting */ stream->flags |= eol_detect; diff --git a/ext/standard/info.c b/ext/standard/info.c index bc0ddddcc0..7a118af7b4 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -61,9 +61,9 @@ PHPAPI extern char *php_ini_opened_path; PHPAPI extern char *php_ini_scanned_path; PHPAPI extern char *php_ini_scanned_files; -static int php_info_print_html_esc(const char *str, int len) /* {{{ */ +static int php_info_print_html_esc(const char *str, size_t len) /* {{{ */ { - int written; + size_t written; zend_string *new_str; TSRMLS_FETCH(); @@ -77,7 +77,7 @@ static int php_info_print_html_esc(const char *str, int len) /* {{{ */ static int php_info_printf(const char *fmt, ...) /* {{{ */ { char *buf; - int len, written; + size_t len, written; va_list argv; TSRMLS_FETCH(); @@ -1026,7 +1026,7 @@ PHPAPI void php_info_print_table_colspan_header(int num_cols, char *header) /* { if (!sapi_module.phpinfo_as_text) { php_info_printf("<tr class=\"h\"><th colspan=\"%d\">%s</th></tr>\n", num_cols, header ); } else { - spaces = (74 - strlen(header)); + spaces = (int)(74 - strlen(header)); php_info_printf("%*s%s%*s\n", (int)(spaces/2), " ", header, (int)(spaces/2), " "); } } @@ -1176,7 +1176,7 @@ PHP_FUNCTION(phpinfo) /* Andale! Andale! Yee-Hah! */ php_output_start_default(TSRMLS_C); - php_print_info(flag TSRMLS_CC); + php_print_info((int)flag TSRMLS_CC); php_output_end(TSRMLS_C); RETURN_TRUE; @@ -1218,7 +1218,7 @@ PHP_FUNCTION(phpcredits) return; } - php_print_credits(flag TSRMLS_CC); + php_print_credits((int)flag TSRMLS_CC); RETURN_TRUE; } /* }}} */ diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c index 692d856757..75bbdd22ce 100644 --- a/ext/standard/iptc.c +++ b/ext/standard/iptc.c @@ -300,8 +300,8 @@ PHP_FUNCTION(iptcparse) { int inx = 0, len; unsigned int tagsfound = 0; - unsigned char *buffer, recnum, dataset, key[ 16 ]; - char *str; + unsigned char *buffer, recnum, dataset; + char *str, key[16]; size_t str_len; zval values, *element; diff --git a/ext/standard/levenshtein.c b/ext/standard/levenshtein.c index df822f45d4..e776934e1f 100644 --- a/ext/standard/levenshtein.c +++ b/ext/standard/levenshtein.c @@ -27,10 +27,11 @@ /* {{{ reference_levdist * reference implementation, only optimized for memory usage, not speed */ -static int reference_levdist(const char *s1, int l1, const char *s2, int l2, int cost_ins, int cost_rep, int cost_del ) +static zend_long reference_levdist(const char *s1, size_t l1, const char *s2, size_t l2, zend_long cost_ins, zend_long cost_rep, zend_long cost_del ) { - int *p1, *p2, *tmp; - int i1, i2, c0, c1, c2; + zend_long *p1, *p2, *tmp; + zend_long c0, c1, c2; + size_t i1, i2; if (l1 == 0) { return l2 * cost_ins; @@ -42,8 +43,8 @@ static int reference_levdist(const char *s1, int l1, const char *s2, int l2, int if ((l1 > LEVENSHTEIN_MAX_LENGTH) || (l2 > LEVENSHTEIN_MAX_LENGTH)) { return -1; } - p1 = safe_emalloc((l2 + 1), sizeof(int), 0); - p2 = safe_emalloc((l2 + 1), sizeof(int), 0); + p1 = safe_emalloc((l2 + 1), sizeof(zend_long), 0); + p2 = safe_emalloc((l2 + 1), sizeof(zend_long), 0); for (i2 = 0; i2 <= l2; i2++) { p1[i2] = i2 * cost_ins; @@ -96,7 +97,7 @@ PHP_FUNCTION(levenshtein) char *callback_name; size_t str1_len, str2_len, callback_len; zend_long cost_ins, cost_rep, cost_del; - int distance = -1; + zend_long distance = -1; switch (argc) { case 2: /* just two strings: use maximum performance version */ diff --git a/ext/standard/mail.c b/ext/standard/mail.c index 96363f4cb9..5d2b576c7e 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -251,7 +251,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char if (mail_log && *mail_log) { char *tmp; time_t curtime; - int l; + size_t l; zend_string *date_str; time(&curtime); diff --git a/ext/standard/math.c b/ext/standard/math.c index 4185cd48f4..31eb259829 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -220,7 +220,7 @@ static double php_asinh(double z) return(asinh(z)); #else # ifdef _WIN64 - if (z > 0) { + if (z >= 0) { return log(z + sqrt(z * z + 1)); } else { @@ -382,7 +382,7 @@ PHP_FUNCTION(round) case IS_DOUBLE: return_val = (Z_TYPE_P(value) == IS_LONG) ? (double)Z_LVAL_P(value) : Z_DVAL_P(value); - return_val = _php_math_round(return_val, places, mode); + return_val = _php_math_round(return_val, (int)places, (int)mode); RETURN_DOUBLE(return_val); break; @@ -946,7 +946,7 @@ PHP_FUNCTION(rad2deg) PHPAPI zend_long _php_math_basetolong(zval *arg, int base) { zend_long num = 0, digit, onum; - int i; + zend_long i; char c, *s; if (Z_TYPE_P(arg) != IS_STRING || base < 2 || base > 36) { @@ -992,7 +992,7 @@ PHPAPI int _php_math_basetozval(zval *arg, int base, zval *ret) { zend_long num = 0; double fnum = 0; - int i; + zend_long i; int mode = 0; char c, *s; zend_long cutoff; @@ -1029,7 +1029,7 @@ PHPAPI int _php_math_basetozval(zval *arg, int base, zval *ret) num = num * base + c; break; } else { - fnum = num; + fnum = (double)num; mode = 1; } /* fall-through */ @@ -1234,10 +1234,10 @@ PHP_FUNCTION(base_convert) RETURN_FALSE; } - if(_php_math_basetozval(number, frombase, &temp) == FAILURE) { + if(_php_math_basetozval(number, (int)frombase, &temp) == FAILURE) { RETURN_FALSE; } - result = _php_math_zvaltobase(&temp, tobase TSRMLS_CC); + result = _php_math_zvaltobase(&temp, (int)tobase TSRMLS_CC); RETVAL_STR(result); } /* }}} */ @@ -1284,15 +1284,15 @@ PHPAPI zend_string *_php_math_number_format_ex(double d, int dec, char *dec_poin /* calculate the length of the return buffer */ if (dp) { - integral = dp - tmpbuf->val; + integral = (int)(dp - tmpbuf->val); } else { /* no decimal point was found */ - integral = tmpbuf->len; + integral = (int)tmpbuf->len; } /* allow for thousand separators */ if (thousand_sep) { - integral += thousand_sep_len * ((integral-1) / 3); + integral += (int)(thousand_sep_len * ((integral-1) / 3)); } reslen = integral; @@ -1301,7 +1301,7 @@ PHPAPI zend_string *_php_math_number_format_ex(double d, int dec, char *dec_poin reslen += dec; if (dec_point) { - reslen += dec_point_len; + reslen += (int)dec_point_len; } } @@ -1319,7 +1319,7 @@ PHPAPI zend_string *_php_math_number_format_ex(double d, int dec, char *dec_poin * Take care, as the sprintf implementation may return less places than * we requested due to internal buffer limitations */ if (dec) { - int declen = dp ? s - dp : 0; + int declen = (int)(dp ? s - dp : 0); int topad = dec > declen ? dec - declen : 0; /* pad with '0's */ @@ -1391,7 +1391,7 @@ PHP_FUNCTION(number_format) RETURN_STR(_php_math_number_format(num, 0, dec_point_chr, thousand_sep_chr)); break; case 2: - RETURN_STR(_php_math_number_format(num, dec, dec_point_chr, thousand_sep_chr)); + RETURN_STR(_php_math_number_format(num, (int)dec, dec_point_chr, thousand_sep_chr)); break; case 4: if (dec_point == NULL) { @@ -1404,7 +1404,7 @@ PHP_FUNCTION(number_format) thousand_sep_len = 1; } - RETVAL_STR(_php_math_number_format_ex(num, dec, + RETVAL_STR(_php_math_number_format_ex(num, (int)dec, dec_point, dec_point_len, thousand_sep, thousand_sep_len)); break; default: diff --git a/ext/standard/md5.c b/ext/standard/md5.c index dc241180ed..e5359c2bcf 100644 --- a/ext/standard/md5.c +++ b/ext/standard/md5.c @@ -61,7 +61,7 @@ PHP_NAMED_FUNCTION(php_if_md5) PHP_MD5Update(&context, arg->val, arg->len); PHP_MD5Final(digest, &context); if (raw_output) { - RETURN_STRINGL(digest, 16); + RETURN_STRINGL((char *) digest, 16); } else { make_digest_ex(md5str, digest, 16); RETVAL_STRING(md5str); @@ -112,7 +112,7 @@ PHP_NAMED_FUNCTION(php_if_md5_file) PHP_MD5Final(digest, &context); if (raw_output) { - RETURN_STRINGL(digest, 16); + RETURN_STRINGL((char *) digest, 16); } else { make_digest_ex(md5str, digest, 16); RETVAL_STRING(md5str); diff --git a/ext/standard/pack.c b/ext/standard/pack.c index f2bcb09723..4af72c34b8 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -55,7 +55,6 @@ #define INC_OUTPUTPOS(a,b) \ if ((a) < 0 || ((INT_MAX - outputpos)/((int)b)) < (a)) { \ - efree(argv); \ efree(formatcodes); \ efree(formatargs); \ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: integer overflow in format string", code); \ @@ -82,6 +81,13 @@ static int machine_endian_long_map[4]; static int big_endian_long_map[4]; static int little_endian_long_map[4]; +#if SIZEOF_ZEND_LONG > 4 +/* Mappings of bytes from quads (64bit) for all endian environments */ +static int machine_endian_longlong_map[8]; +static int big_endian_longlong_map[8]; +static int little_endian_longlong_map[8]; +#endif + /* {{{ php_pack */ static void php_pack(zval *val, size_t size, int *map, char *output) @@ -98,8 +104,8 @@ static void php_pack(zval *val, size_t size, int *map, char *output) } /* }}} */ -/* pack() idea stolen from Perl (implemented formats behave the same as there) - * Implemented formats are Z, A, a, h, H, c, C, s, S, i, I, l, L, n, N, f, d, x, X, @. +/* pack() idea stolen from Perl (implemented formats behave the same as there except J and P) + * Implemented formats are Z, A, a, h, H, c, C, s, S, i, I, l, L, n, N, q, Q, J, P, f, d, x, X, @. */ /* {{{ proto string pack(string format, mixed arg1 [, mixed arg2 [, mixed ...]]) Takes one or more arguments and packs them into a binary string according to the format argument */ @@ -198,6 +204,16 @@ PHP_FUNCTION(pack) break; /* Use as many args as specified */ + case 'q': + case 'Q': + case 'J': + case 'P': +#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"); + RETURN_FALSE; +#endif case 'c': case 'C': case 's': @@ -280,6 +296,15 @@ PHP_FUNCTION(pack) INC_OUTPUTPOS(arg,4) /* 32 bit per arg */ break; +#if SIZEOF_ZEND_LONG > 4 + case 'q': + case 'Q': + case 'J': + case 'P': + INC_OUTPUTPOS(arg,8) /* 32 bit per arg */ + break; +#endif + case 'f': INC_OUTPUTPOS(arg,sizeof(float)) break; @@ -430,6 +455,27 @@ PHP_FUNCTION(pack) break; } +#if SIZEOF_ZEND_LONG > 4 + case 'q': + case 'Q': + case 'J': + case 'P': { + int *map = machine_endian_longlong_map; + + if (code == 'J') { + map = big_endian_longlong_map; + } else if (code == 'P') { + map = little_endian_longlong_map; + } + + while (arg-- > 0) { + php_pack(&argv[currentarg++], 8, map, &output[outputpos]); + outputpos += 8; + } + break; + } +#endif + case 'f': { while (arg-- > 0) { float v = (float) zval_get_double(&argv[currentarg++]); @@ -506,7 +552,7 @@ static zend_long php_unpack(char *data, size_t size, int issigned, int *map) * chars1, chars2, and ints. * Numeric pack types will return numbers, a and A will return strings, * f and d will return doubles. - * Implemented formats are Z, A, a, h, H, c, C, s, S, i, I, l, L, n, N, f, d, x, X, @. + * Implemented formats are Z, A, a, h, H, c, C, s, S, i, I, l, L, n, N, q, Q, J, P, f, d, x, X, @. */ /* {{{ proto array unpack(string format, string input) Unpack binary string into named array elements according to format argument */ @@ -622,6 +668,20 @@ PHP_FUNCTION(unpack) size = 4; break; + /* Use 8 bytes of input */ + case 'q': + case 'Q': + case 'J': + case 'P': +#if SIZEOF_ZEND_LONG > 4 + 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"); + zval_dtor(return_value); + RETURN_FALSE; +#endif + /* Use sizeof(float) bytes of input */ case 'f': size = sizeof(float); @@ -845,6 +905,38 @@ PHP_FUNCTION(unpack) break; } +#if SIZEOF_ZEND_LONG > 4 + case 'q': + case 'Q': + case 'J': + case 'P': { + int issigned = 0; + int *map = machine_endian_longlong_map; + zend_long v = 0; + + if (type == 'q' || type == 'Q') { + issigned = input[inputpos + (machine_little_endian ? 7 : 0)] & 0x80; + } else if (type == 'J') { + issigned = input[inputpos] & 0x80; + map = big_endian_longlong_map; + } else if (type == 'P') { + issigned = input[inputpos + 7] & 0x80; + map = little_endian_longlong_map; + } + + v = php_unpack(&input[inputpos], 8, issigned, map); + + if (type == 'q') { + v = (zend_long) v; + } else { + v = (zend_ulong) v; + } + + add_assoc_long(return_value, n, v); + break; + } +#endif + case 'f': { float v; @@ -948,6 +1040,33 @@ PHP_MINIT_FUNCTION(pack) little_endian_long_map[1] = 1; little_endian_long_map[2] = 2; little_endian_long_map[3] = 3; + +#if SIZEOF_ZEND_LONG > 4 + machine_endian_longlong_map[0] = 0; + machine_endian_longlong_map[1] = 1; + machine_endian_longlong_map[2] = 2; + machine_endian_longlong_map[3] = 3; + machine_endian_longlong_map[4] = 4; + machine_endian_longlong_map[5] = 5; + machine_endian_longlong_map[6] = 6; + machine_endian_longlong_map[7] = 7; + big_endian_longlong_map[0] = 7; + big_endian_longlong_map[1] = 6; + big_endian_longlong_map[2] = 5; + big_endian_longlong_map[3] = 4; + big_endian_longlong_map[4] = 3; + big_endian_longlong_map[5] = 2; + big_endian_longlong_map[6] = 1; + big_endian_longlong_map[7] = 0; + little_endian_longlong_map[0] = 0; + little_endian_longlong_map[1] = 1; + little_endian_longlong_map[2] = 2; + little_endian_longlong_map[3] = 3; + little_endian_longlong_map[4] = 4; + little_endian_longlong_map[5] = 5; + little_endian_longlong_map[6] = 6; + little_endian_longlong_map[7] = 7; +#endif } else { zval val; @@ -980,6 +1099,33 @@ PHP_MINIT_FUNCTION(pack) little_endian_long_map[1] = size - 2; little_endian_long_map[2] = size - 3; little_endian_long_map[3] = size - 4; + +#if SIZEOF_ZEND_LONG > 4 + machine_endian_longlong_map[0] = size - 8; + machine_endian_longlong_map[1] = size - 7; + machine_endian_longlong_map[2] = size - 6; + machine_endian_longlong_map[3] = size - 5; + machine_endian_longlong_map[0] = size - 4; + machine_endian_longlong_map[1] = size - 3; + machine_endian_longlong_map[2] = size - 2; + machine_endian_longlong_map[3] = size - 1; + big_endian_longlong_map[0] = size - 8; + big_endian_longlong_map[1] = size - 7; + big_endian_longlong_map[2] = size - 6; + big_endian_longlong_map[3] = size - 5; + big_endian_longlong_map[0] = size - 4; + big_endian_longlong_map[1] = size - 3; + big_endian_longlong_map[2] = size - 2; + big_endian_longlong_map[3] = size - 1; + little_endian_longlong_map[0] = size - 1; + little_endian_longlong_map[1] = size - 2; + little_endian_longlong_map[2] = size - 3; + little_endian_longlong_map[3] = size - 4; + little_endian_longlong_map[0] = size - 5; + little_endian_longlong_map[1] = size - 6; + little_endian_longlong_map[2] = size - 7; + little_endian_longlong_map[3] = size - 8; +#endif } return SUCCESS; diff --git a/ext/standard/password.c b/ext/standard/password.c index 0f75272d0e..c58c28ab3c 100644 --- a/ext/standard/password.c +++ b/ext/standard/password.c @@ -268,7 +268,7 @@ PHP_FUNCTION(password_verify) if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &password, &password_len, &hash, &hash_len) == FAILURE) { RETURN_FALSE; } - if ((ret = php_crypt(password, password_len, hash, hash_len)) == NULL) { + if ((ret = php_crypt(password, (int)password_len, hash, (int)hash_len)) == NULL) { RETURN_FALSE; } @@ -298,7 +298,8 @@ PHP_FUNCTION(password_hash) { char *hash_format, *hash, *salt, *password; zend_long algo = 0; - size_t password_len = 0, hash_len; + size_t password_len = 0; + int hash_len; size_t salt_len = 0, required_salt_len = 0, hash_format_len; HashTable *options = 0; zval *option_buffer; @@ -344,7 +345,7 @@ PHP_FUNCTION(password_hash) if (options && (option_buffer = zend_symtable_str_find(options, "salt", sizeof("salt")-1)) != NULL) { char *buffer; - int buffer_len_int = 0; + size_t buffer_len_int = 0; size_t buffer_len; switch (Z_TYPE_P(option_buffer)) { case IS_STRING: @@ -425,7 +426,7 @@ PHP_FUNCTION(password_hash) /* This cast is safe, since both values are defined here in code and cannot overflow */ hash_len = (int) (hash_format_len + salt_len); - if ((result = php_crypt(password, password_len, hash, hash_len)) == NULL) { + if ((result = php_crypt(password, (int)password_len, hash, hash_len)) == NULL) { efree(hash); RETURN_FALSE; } diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 575e8fff98..1989a2eabc 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -80,7 +80,7 @@ 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) < input->position + count) { + 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); @@ -323,7 +323,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa return NULL; } - fd = dup(fildes_ori); + fd = dup((int)fildes_ori); if (fd == -1) { php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Error duping file descriptor " ZEND_LONG_FMT "; possibly it doesn't exist: " diff --git a/ext/standard/php_http.h b/ext/standard/php_http.h index 0979348314..712e297fe3 100644 --- a/ext/standard/php_http.h +++ b/ext/standard/php_http.h @@ -25,9 +25,9 @@ #include "zend_smart_str.h" PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, - const char *num_prefix, int num_prefix_len, - const char *key_prefix, int key_prefix_len, - const char *key_suffix, int key_suffix_len, + 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) diff --git a/ext/standard/php_incomplete_class.h b/ext/standard/php_incomplete_class.h index 6001e35bbe..177e960765 100644 --- a/ext/standard/php_incomplete_class.h +++ b/ext/standard/php_incomplete_class.h @@ -28,15 +28,14 @@ #define PHP_SET_CLASS_ATTRIBUTES(struc) \ /* OBJECTS_FIXME: Fix for new object model */ \ - if (Z_OBJ_HT_P(struc)->get_class_entry && \ - Z_OBJCE_P(struc) == BG(incomplete_class)) { \ + if (Z_OBJCE_P(struc) == BG(incomplete_class)) { \ class_name = php_lookup_class_name(struc); \ if (!class_name) { \ class_name = zend_string_init(INCOMPLETE_CLASS, sizeof(INCOMPLETE_CLASS) - 1, 0); \ } \ incomplete_class = 1; \ } else { \ - class_name = zend_get_object_classname(Z_OBJ_P(struc) TSRMLS_CC); \ + class_name = zend_string_copy(Z_OBJCE_P(struc)->name); \ } #define PHP_CLEANUP_CLASS_ATTRIBUTES() \ diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h index 9e872222fd..0b655bfbdf 100644 --- a/ext/standard/php_string.h +++ b/ext/standard/php_string.h @@ -137,8 +137,8 @@ PHPAPI size_t php_strip_tags(char *rbuf, size_t len, int *state, char *allow, si 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(zval *delim, zval *arr, zval *return_value TSRMLS_DC); -PHPAPI void php_explode(zval *delim, zval *str, zval *return_value, zend_long limit); +PHPAPI void php_implode(const zend_string *delim, zval *arr, zval *return_value TSRMLS_DC); +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); diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h index 90979159ab..23225cdc42 100644 --- a/ext/standard/php_var.h +++ b/ext/standard/php_var.h @@ -38,7 +38,10 @@ PHPAPI void php_var_export_ex(zval *struc, int level, smart_str *buf TSRMLS_DC); PHPAPI void php_debug_zval_dump(zval *struc, int level TSRMLS_DC); -typedef HashTable* php_serialize_data_t; +struct php_serialize_data { + HashTable ht; + uint32_t n; +}; struct php_unserialize_data { void *first; @@ -47,71 +50,67 @@ struct php_unserialize_data { void *last_dtor; }; -typedef struct php_unserialize_data* php_unserialize_data_t; +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 *var_hash TSRMLS_DC); +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); -#define PHP_VAR_SERIALIZE_INIT(var_hash_ptr) \ +#define PHP_VAR_SERIALIZE_INIT(d) \ do { \ /* fprintf(stderr, "SERIALIZE_INIT == lock: %u, level: %u\n", BG(serialize_lock), BG(serialize).level); */ \ if (BG(serialize_lock) || !BG(serialize).level) { \ - ALLOC_HASHTABLE(var_hash_ptr); \ - zend_hash_init((var_hash_ptr), 16, NULL, NULL, 0); \ + (d) = (php_serialize_data_t) emalloc(sizeof(struct php_serialize_data)); \ + zend_hash_init(&(d)->ht, 16, NULL, ZVAL_PTR_DTOR, 0); \ + (d)->n = 0; \ if (!BG(serialize_lock)) { \ - BG(serialize).var_hash = (void *)(var_hash_ptr); \ + BG(serialize).data = d; \ BG(serialize).level = 1; \ } \ } else { \ - (var_hash_ptr) = (php_serialize_data_t)BG(serialize).var_hash; \ + (d) = BG(serialize).data; \ ++BG(serialize).level; \ } \ } while(0) -#define PHP_VAR_SERIALIZE_DESTROY(var_hash_ptr) \ +#define PHP_VAR_SERIALIZE_DESTROY(d) \ do { \ /* fprintf(stderr, "SERIALIZE_DESTROY == lock: %u, level: %u\n", BG(serialize_lock), BG(serialize).level); */ \ - if (BG(serialize_lock) || !BG(serialize).level) { \ - zend_hash_destroy((var_hash_ptr)); \ - FREE_HASHTABLE(var_hash_ptr); \ - } else { \ - if (!--BG(serialize).level) { \ - zend_hash_destroy((php_serialize_data_t)BG(serialize).var_hash); \ - FREE_HASHTABLE((php_serialize_data_t)BG(serialize).var_hash); \ - BG(serialize).var_hash = NULL; \ - } \ + if (BG(serialize_lock) || BG(serialize).level == 1) { \ + zend_hash_destroy(&(d)->ht); \ + efree((d)); \ + } \ + if (!BG(serialize_lock) && !--BG(serialize).level) { \ + BG(serialize).data = NULL; \ } \ } while (0) -#define PHP_VAR_UNSERIALIZE_INIT(var_hash_ptr) \ +#define PHP_VAR_UNSERIALIZE_INIT(d) \ do { \ /* fprintf(stderr, "UNSERIALIZE_INIT == lock: %u, level: %u\n", BG(serialize_lock), BG(unserialize).level); */ \ if (BG(serialize_lock) || !BG(unserialize).level) { \ - (var_hash_ptr) = (php_unserialize_data_t)ecalloc(1, sizeof(struct php_unserialize_data)); \ + (d) = (php_unserialize_data_t)ecalloc(1, sizeof(struct php_unserialize_data)); \ if (!BG(serialize_lock)) { \ - BG(unserialize).var_hash = (void *)(var_hash_ptr); \ + BG(unserialize).data = (d); \ BG(unserialize).level = 1; \ } \ } else { \ - (var_hash_ptr) = (php_unserialize_data_t)BG(unserialize).var_hash; \ + (d) = BG(unserialize).data; \ ++BG(unserialize).level; \ } \ } while (0) -#define PHP_VAR_UNSERIALIZE_DESTROY(var_hash_ptr) \ +#define PHP_VAR_UNSERIALIZE_DESTROY(d) \ do { \ /* fprintf(stderr, "UNSERIALIZE_DESTROY == lock: %u, level: %u\n", BG(serialize_lock), BG(unserialize).level); */ \ - if (BG(serialize_lock) || !BG(unserialize).level) { \ - var_destroy(&(var_hash_ptr)); \ - efree(var_hash_ptr); \ - } else { \ - if (!--BG(unserialize).level) { \ - var_destroy(&(var_hash_ptr)); \ - efree((var_hash_ptr)); \ - BG(unserialize).var_hash = NULL; \ - } \ + if (BG(serialize_lock) || BG(unserialize).level == 1) { \ + var_destroy(&(d)); \ + efree((d)); \ + } \ + if (!BG(serialize_lock) && !--BG(unserialize).level) { \ + BG(unserialize).data = NULL; \ } \ } while (0) @@ -120,50 +119,4 @@ PHPAPI void var_push_dtor(php_unserialize_data_t *var_hash, zval *val); PHPAPI void var_push_dtor_no_addref(php_unserialize_data_t *var_hashx, zval *rval); PHPAPI void var_destroy(php_unserialize_data_t *var_hash); -PHPAPI zend_class_entry *php_create_empty_class(char *class_name, int len); - -static inline int php_varname_check(char *name, int name_len, zend_bool silent TSRMLS_DC) /* {{{ */ -{ - if (name_len == sizeof("GLOBALS") - 1 && !memcmp(name, "GLOBALS", sizeof("GLOBALS") - 1)) { - if (!silent) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attempted GLOBALS variable overwrite"); - } - return FAILURE; - } else if (name[0] == '_' && - ( - (name_len == sizeof("_GET") - 1 && !memcmp(name, "_GET", sizeof("_GET") - 1)) || - (name_len == sizeof("_POST") - 1 && !memcmp(name, "_POST", sizeof("_POST") - 1)) || - (name_len == sizeof("_COOKIE") - 1 && !memcmp(name, "_COOKIE", sizeof("_COOKIE") - 1)) || - (name_len == sizeof("_ENV") - 1 && !memcmp(name, "_ENV", sizeof("_ENV") - 1)) || - (name_len == sizeof("_SERVER") - 1 && !memcmp(name, "_SERVER", sizeof("_SERVER") - 1)) || - (name_len == sizeof("_SESSION") - 1 && !memcmp(name, "_SESSION", sizeof("_SESSION") - 1)) || - (name_len == sizeof("_FILES") - 1 && !memcmp(name, "_FILES", sizeof("_FILES") - 1)) || - (name_len == sizeof("_REQUEST") -1 && !memcmp(name, "_REQUEST", sizeof("_REQUEST") - 1)) - ) - ) { - if (!silent) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attempted super-global (%s) variable overwrite", name); - } - return FAILURE; - } else if (name[0] == 'H' && - ( - (name_len == sizeof("HTTP_POST_VARS") - 1 && !memcmp(name, "HTTP_POST_VARS", sizeof("HTTP_POST_VARS") - 1)) || - (name_len == sizeof("HTTP_GET_VARS") - 1 && !memcmp(name, "HTTP_GET_VARS", sizeof("HTTP_GET_VARS") - 1)) || - (name_len == sizeof("HTTP_COOKIE_VARS") - 1 && !memcmp(name, "HTTP_COOKIE_VARS", sizeof("HTTP_COOKIE_VARS") - 1)) || - (name_len == sizeof("HTTP_ENV_VARS") - 1 && !memcmp(name, "HTTP_ENV_VARS", sizeof("HTTP_ENV_VARS") - 1)) || - (name_len == sizeof("HTTP_SERVER_VARS") - 1 && !memcmp(name, "HTTP_SERVER_VARS", sizeof("HTTP_SERVER_VARS") - 1)) || - (name_len == sizeof("HTTP_SESSION_VARS") - 1 && !memcmp(name, "HTTP_SESSION_VARS", sizeof("HTTP_SESSION_VARS") - 1)) || - (name_len == sizeof("HTTP_RAW_POST_DATA") - 1 && !memcmp(name, "HTTP_RAW_POST_DATA", sizeof("HTTP_RAW_POST_DATA") - 1)) || - (name_len == sizeof("HTTP_POST_FILES") - 1 && !memcmp(name, "HTTP_POST_FILES", sizeof("HTTP_POST_FILES") - 1)) - ) - ) { - if (!silent) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attempted long input array (%s) overwrite", name); - } - return FAILURE; - } - return SUCCESS; -} -/* }}} */ - #endif /* PHP_VAR_H */ diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index 66c0c2e7e3..d6a6f2be50 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -82,7 +82,7 @@ static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent char **ep; #endif char *p; - uint cnt, l, sizeenv=0; + size_t cnt, l, sizeenv=0; HashTable *target_hash; memset(&env, 0, sizeof(env)); @@ -109,7 +109,7 @@ static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent /* first, we have to get the size of all the elements in the hash */ ZEND_HASH_FOREACH_STR_KEY_VAL(target_hash, string_key, element) { zend_string *str = zval_get_string(element); - uint el_len = str->len; + size_t el_len = str->len; zend_string_release(str); if (el_len == 0) { @@ -512,7 +512,7 @@ PHP_FUNCTION(proc_open) goto exit_fail; } - descriptors[ndesc].index = nindex; + descriptors[ndesc].index = (int)nindex; if (Z_TYPE_P(descitem) == IS_RESOURCE) { /* should be a stream - try and dup the descriptor */ @@ -526,7 +526,7 @@ PHP_FUNCTION(proc_open) } #ifdef PHP_WIN32 - descriptors[ndesc].childend = dup_fd_as_handle(fd); + 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); goto exit_fail; @@ -621,8 +621,8 @@ PHP_FUNCTION(proc_open) } #ifdef PHP_WIN32 - descriptors[ndesc].childend = dup_fd_as_handle(fd); - _close(fd); + descriptors[ndesc].childend = dup_fd_as_handle((int)fd); + _close((int)fd); /* simulate the append mode by fseeking to the end of the file this introduces a potential race-condition, but it is the best we can do, though */ diff --git a/ext/standard/quot_print.c b/ext/standard/quot_print.c index c7eddc576b..441b65288c 100644 --- a/ext/standard/quot_print.c +++ b/ext/standard/quot_print.c @@ -53,7 +53,7 @@ static char php_hex2int(int c) /* {{{ */ PHPAPI zend_string *php_quot_print_decode(const unsigned char *str, size_t length, int replace_us_by_ws) /* {{{ */ { - register unsigned int i; + register size_t i; register unsigned const char *p1; register unsigned char *p2; register unsigned int h_nbl, l_nbl; diff --git a/ext/standard/sha1.c b/ext/standard/sha1.c index cd8b82f5e1..249828fb3d 100644 --- a/ext/standard/sha1.c +++ b/ext/standard/sha1.c @@ -46,10 +46,10 @@ PHP_FUNCTION(sha1) sha1str[0] = '\0'; PHP_SHA1Init(&context); - PHP_SHA1Update(&context, arg->val, arg->len); + PHP_SHA1Update(&context, (unsigned char *) arg->val, arg->len); PHP_SHA1Final(digest, &context); if (raw_output) { - RETURN_STRINGL(digest, 20); + RETURN_STRINGL((char *) digest, 20); } else { make_digest_ex(sha1str, digest, 20); RETVAL_STRING(sha1str); @@ -71,7 +71,7 @@ PHP_FUNCTION(sha1_file) unsigned char buf[1024]; unsigned char digest[20]; PHP_SHA1_CTX context; - int n; + size_t n; php_stream *stream; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|b", &arg, &arg_len, &raw_output) == FAILURE) { @@ -85,7 +85,7 @@ PHP_FUNCTION(sha1_file) PHP_SHA1Init(&context); - while ((n = php_stream_read(stream, buf, sizeof(buf))) > 0) { + while ((n = php_stream_read(stream, (char *) buf, sizeof(buf))) > 0) { PHP_SHA1Update(&context, buf, n); } @@ -93,12 +93,8 @@ PHP_FUNCTION(sha1_file) php_stream_close(stream); - if (n<0) { - RETURN_FALSE; - } - if (raw_output) { - RETURN_STRINGL(digest, 20); + RETURN_STRINGL((char *) digest, 20); } else { make_digest_ex(sha1str, digest, 20); RETVAL_STRING(sha1str); diff --git a/ext/standard/soundex.c b/ext/standard/soundex.c index feb9a6780e..d882f5cab6 100644 --- a/ext/standard/soundex.c +++ b/ext/standard/soundex.c @@ -78,7 +78,7 @@ PHP_FUNCTION(soundex) if (code >= 'A' && code <= 'Z') { if (_small == 0) { /* remember first valid char */ - soundex[_small++] = code; + soundex[_small++] = (char)code; last = soundex_table[code - 'A']; } else { @@ -88,7 +88,7 @@ PHP_FUNCTION(soundex) code = soundex_table[code - 'A']; if (code != last) { if (code != 0) { - soundex[_small++] = code; + soundex[_small++] = (char)code; } last = code; } diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index f864994d28..51e3c14e7a 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -60,7 +60,7 @@ PHP_FUNCTION(stream_socket_pair) RETURN_FALSE; } - if (0 != socketpair(domain, type, protocol, pair)) { + 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_socket_errno(), php_socket_strerror(php_socket_errno(), errbuf, sizeof(errbuf))); @@ -90,7 +90,7 @@ PHP_FUNCTION(stream_socket_client) char *host; size_t host_len; zval *zerrno = NULL, *zerrstr = NULL, *zcontext = NULL; - double timeout = FG(default_socket_timeout); + double timeout = (double)FG(default_socket_timeout); php_timeout_ull conv; struct timeval tv; char *hashkey = NULL; @@ -206,7 +206,7 @@ PHP_FUNCTION(stream_socket_server) } stream = php_stream_xport_create(host, host_len, REPORT_ERRORS, - STREAM_XPORT_SERVER | flags, + STREAM_XPORT_SERVER | (int)flags, NULL, NULL, context, &errstr, &err); if (stream == NULL) { @@ -239,7 +239,7 @@ PHP_FUNCTION(stream_socket_server) Accept a client connection from a server socket */ PHP_FUNCTION(stream_socket_accept) { - double timeout = FG(default_socket_timeout); + double timeout = (double)FG(default_socket_timeout); zval *zpeername = NULL; zend_string *peername = NULL; php_timeout_ull conv; @@ -340,7 +340,7 @@ PHP_FUNCTION(stream_socket_sendto) } } - RETURN_LONG(php_stream_xport_sendto(stream, data, datalen, flags, target_addr ? &sa : NULL, sl TSRMLS_CC)); + RETURN_LONG(php_stream_xport_sendto(stream, data, datalen, (int)flags, target_addr ? &sa : NULL, sl TSRMLS_CC)); } /* }}} */ @@ -374,7 +374,7 @@ PHP_FUNCTION(stream_socket_recvfrom) read_buf = zend_string_alloc(to_read, 0); - recvd = php_stream_xport_recvfrom(stream, read_buf->val, to_read, flags, NULL, NULL, + recvd = php_stream_xport_recvfrom(stream, read_buf->val, to_read, (int)flags, NULL, NULL, zremote ? &remote_addr : NULL TSRMLS_CC); @@ -410,7 +410,7 @@ PHP_FUNCTION(stream_get_contents) if (desiredpos >= 0) { int seek_res = 0; - off_t position; + zend_off_t position; position = php_stream_tell(stream); if (position >= 0 && desiredpos > position) { @@ -773,6 +773,10 @@ PHP_FUNCTION(stream_select) RETURN_FALSE; } +#ifdef PHP_WIN32 + tv.tv_sec = (long)(Z_LVAL_P(sec) + (usec / 1000000)); + tv.tv_usec = (long)(usec % 1000000); +#else /* Solaris + BSD do not like microsecond values which are >= 1 sec */ if (usec > 999999) { tv.tv_sec = Z_LVAL_P(sec) + (usec / 1000000); @@ -781,7 +785,7 @@ PHP_FUNCTION(stream_select) tv.tv_sec = Z_LVAL_P(sec); tv.tv_usec = usec; } - +#endif tv_p = &tv; } @@ -1275,19 +1279,16 @@ PHP_FUNCTION(stream_get_line) PHP_FUNCTION(stream_set_blocking) { zval *arg1; - int block; - zend_long arg2; + zend_long block; php_stream *stream; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &arg2) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &block) == FAILURE) { return; } php_stream_from_zval(stream, arg1); - block = arg2; - - if (php_stream_set_option(stream, PHP_STREAM_OPTION_BLOCKING, block == 0 ? 0 : 1, NULL) == -1) { + if (php_stream_set_option(stream, PHP_STREAM_OPTION_BLOCKING, block ? 1 : 0, NULL) == -1) { RETURN_FALSE; } @@ -1313,6 +1314,16 @@ PHP_FUNCTION(stream_set_timeout) php_stream_from_zval(stream, socket); +#ifdef PHP_WIN32 + t.tv_sec = (long)seconds; + + if (argc == 3) { + t.tv_usec = (long)(microseconds % 1000000); + t.tv_sec +=(long)(microseconds / 1000000); + } else { + t.tv_usec = 0; + } +#else t.tv_sec = seconds; if (argc == 3) { @@ -1321,6 +1332,7 @@ PHP_FUNCTION(stream_set_timeout) } else { t.tv_usec = 0; } +#endif if (PHP_STREAM_OPTION_RETURN_OK == php_stream_set_option(stream, PHP_STREAM_OPTION_READ_TIMEOUT, 0, &t)) { RETURN_TRUE; @@ -1485,7 +1497,7 @@ PHP_FUNCTION(stream_resolve_include_path) return; } - resolved_path = zend_resolve_path(filename, filename_len TSRMLS_CC); + resolved_path = zend_resolve_path(filename, (int)filename_len TSRMLS_CC); if (resolved_path) { // TODO: avoid reallocation ??? diff --git a/ext/standard/string.c b/ext/standard/string.c index dcd6f09a9c..152ae6d66f 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1013,41 +1013,36 @@ PHP_FUNCTION(wordwrap) /* {{{ php_explode */ -PHPAPI void php_explode(zval *delim, zval *str, zval *return_value, zend_long limit) +PHPAPI void php_explode(const zend_string *delim, zend_string *str, zval *return_value, zend_long limit) { - char *p1, *p2, *endp; - - endp = Z_STRVAL_P(str) + Z_STRLEN_P(str); - - p1 = Z_STRVAL_P(str); - p2 = (char*)php_memnstr(Z_STRVAL_P(str), Z_STRVAL_P(delim), Z_STRLEN_P(delim), endp); + char *p1 = str->val; + char *endp = str->val + str->len; + char *p2 = (char *) php_memnstr(str->val, delim->val, delim->len, endp); if (p2 == NULL) { - add_next_index_stringl(return_value, p1, Z_STRLEN_P(str)); + add_next_index_str(return_value, zend_string_copy(str)); } else { do { add_next_index_stringl(return_value, p1, p2 - p1); - p1 = p2 + Z_STRLEN_P(delim); - } while ((p2 = (char*)php_memnstr(p1, Z_STRVAL_P(delim), Z_STRLEN_P(delim), endp)) != NULL && - --limit > 1); + p1 = p2 + delim->len; + p2 = (char *) php_memnstr(p1, delim->val, delim->len, endp); + } while (p2 != NULL && --limit > 1); - if (p1 <= endp) - add_next_index_stringl(return_value, p1, endp-p1); + if (p1 <= endp) { + add_next_index_stringl(return_value, p1, endp - p1); + } } } /* }}} */ /* {{{ php_explode_negative_limit */ -PHPAPI void php_explode_negative_limit(zval *delim, zval *str, zval *return_value, zend_long limit) +PHPAPI void php_explode_negative_limit(const zend_string *delim, zend_string *str, zval *return_value, zend_long limit) { #define EXPLODE_ALLOC_STEP 64 - char *p1, *p2, *endp; - - endp = Z_STRVAL_P(str) + Z_STRLEN_P(str); - - p1 = Z_STRVAL_P(str); - p2 = (char*)php_memnstr(Z_STRVAL_P(str), Z_STRVAL_P(delim), Z_STRLEN_P(delim), endp); + char *p1 = str->val; + char *endp = str->val + str->len; + char *p2 = (char *) php_memnstr(str->val, delim->val, delim->len, endp); if (p2 == NULL) { /* @@ -1065,14 +1060,15 @@ PHPAPI void php_explode_negative_limit(zval *delim, zval *str, zval *return_valu allocated = found + EXPLODE_ALLOC_STEP;/* make sure we have enough memory */ positions = erealloc(positions, allocated*sizeof(char *)); } - positions[found++] = p1 = p2 + Z_STRLEN_P(delim); - } while ((p2 = (char*)php_memnstr(p1, Z_STRVAL_P(delim), Z_STRLEN_P(delim), endp)) != NULL); + positions[found++] = p1 = p2 + delim->len; + p2 = (char *) php_memnstr(p1, delim->val, delim->len, endp); + } while (p2 != NULL); to_return = limit + found; /* limit is at least -1 therefore no need of bounds checking : i will be always less than found */ - for (i = 0;i < to_return;i++) { /* this checks also for to_return > 0 */ + for (i = 0; i < to_return; i++) { /* this checks also for to_return > 0 */ add_next_index_stringl(return_value, positions[i], - (positions[i+1] - Z_STRLEN_P(delim)) - positions[i]); + (positions[i+1] - delim->len) - positions[i]); } efree(positions); } @@ -1086,7 +1082,6 @@ PHP_FUNCTION(explode) { zend_string *str, *delim; zend_long limit = ZEND_LONG_MAX; /* No limit */ - zval zdelim, zstr; #ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|l", &delim, &str, &limit) == FAILURE) { @@ -1110,17 +1105,15 @@ PHP_FUNCTION(explode) if (str->len == 0) { if (limit >= 0) { - add_next_index_stringl(return_value, "", sizeof("") - 1); + add_next_index_str(return_value, STR_EMPTY_ALLOC()); } return; } - ZVAL_STR(&zstr, str); - ZVAL_STR(&zdelim, delim); if (limit > 1) { - php_explode(&zdelim, &zstr, return_value, limit); + php_explode(delim, str, return_value, limit); } else if (limit < 0) { - php_explode_negative_limit(&zdelim, &zstr, return_value, limit); + php_explode_negative_limit(delim, str, return_value, limit); } else { add_index_stringl(return_value, 0, str->val, str->len); } @@ -1133,7 +1126,7 @@ PHP_FUNCTION(explode) /* {{{ php_implode */ -PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value TSRMLS_DC) +PHPAPI void php_implode(const zend_string *delim, zval *arr, zval *return_value TSRMLS_DC) { zval *tmp; smart_str implstr = {0}; @@ -1170,8 +1163,8 @@ again: size_t str_len = spprintf(&stmp, 0, "%.*G", (int) EG(precision), Z_DVAL_P(tmp)); smart_str_appendl(&implstr, stmp, str_len); efree(stmp); - } break; + } case IS_REFERENCE: tmp = Z_REFVAL_P(tmp); @@ -1186,7 +1179,7 @@ again: } if (++i != numelems) { - smart_str_append(&implstr, Z_STR_P(delim)); + smart_str_append(&implstr, delim); } } ZEND_HASH_FOREACH_END(); @@ -1205,7 +1198,8 @@ again: Joins array elements placing glue string between items and return one string */ PHP_FUNCTION(implode) { - zval *arg1 = NULL, *arg2 = NULL, *delim, *arr, tmp; + zval *arg1, *arg2 = NULL, *arr; + zend_string *delim; #ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|z", &arg1, &arg2) == FAILURE) { @@ -1225,20 +1219,15 @@ PHP_FUNCTION(implode) return; } - ZVAL_EMPTY_STRING(&tmp); - delim = &tmp; - - SEPARATE_ZVAL(arg1); + delim = STR_EMPTY_ALLOC(); arr = arg1; } else { if (Z_TYPE_P(arg1) == IS_ARRAY) { + delim = zval_get_string(arg2); arr = arg1; - convert_to_string_ex(arg2); - delim = arg2; } else if (Z_TYPE_P(arg2) == IS_ARRAY) { + delim = zval_get_string(arg1); arr = arg2; - convert_to_string_ex(arg1); - delim = arg1; } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid arguments passed"); return; @@ -1246,6 +1235,7 @@ PHP_FUNCTION(implode) } php_implode(delim, arr, return_value TSRMLS_CC); + zend_string_release(delim); } /* }}} */ @@ -1673,12 +1663,10 @@ static int php_needle_char(zval *needle, char *target TSRMLS_DC) return SUCCESS; case IS_OBJECT: { - zval holder = *needle; - zval_copy_ctor(&(holder)); - convert_to_long(&(holder)); - if(Z_TYPE(holder) != IS_LONG) { - return FAILURE; - } + zval holder; + + ZVAL_LONG(&holder, zval_get_long(needle)); + *target = (char)Z_LVAL(holder); return SUCCESS; } @@ -2776,20 +2764,20 @@ PHP_FUNCTION(ucwords) PHPAPI char *php_strtr(char *str, size_t len, char *str_from, char *str_to, size_t trlen) { size_t i; - unsigned char xlat[256]; + unsigned char xlat[256], j = 0; if ((trlen < 1) || (len < 1)) { return str; } - for (i = 0; i < 256; xlat[i] = i, i++); + do { xlat[j] = j; } while (++j != 0); for (i = 0; i < trlen; i++) { - xlat[(unsigned char) str_from[i]] = str_to[i]; + xlat[(size_t)(unsigned char) str_from[i]] = str_to[i]; } for (i = 0; i < len; i++) { - str[i] = xlat[(unsigned char) str[i]]; + str[i] = xlat[(size_t)(unsigned char) str[i]]; } return str; @@ -3983,7 +3971,7 @@ static void php_hebrev(INTERNAL_FUNCTION_PARAMETERS, int convert_newlines) while (1) { char_count=0; - while ((!max_chars || max_chars > 0 && char_count < max_chars) && begin > 0) { + while ((!max_chars || (max_chars > 0 && char_count < max_chars)) && begin > 0) { char_count++; begin--; if (begin <= 0 || _isnewline(heb_str[begin])) { @@ -4195,7 +4183,7 @@ PHP_FUNCTION(setlocale) #ifdef HAVE_SETLOCALE if (Z_TYPE_P(pcategory) == IS_LONG) { - cat = Z_LVAL_P(pcategory); + cat = (int)Z_LVAL_P(pcategory); } else { /* FIXME: The following behaviour should be removed. */ char *category; @@ -4906,14 +4894,14 @@ PHP_FUNCTION(localeconv) localeconv_r( &currlocdata ); /* Grab the grouping data out of the array */ - len = strlen(currlocdata.grouping); + len = (int)strlen(currlocdata.grouping); for (i = 0; i < len; i++) { add_index_long(&grouping, i, currlocdata.grouping[i]); } /* Grab the monetary grouping data out of the array */ - len = strlen(currlocdata.mon_grouping); + len = (int)strlen(currlocdata.mon_grouping); for (i = 0; i < len; i++) { add_index_long(&mon_grouping, i, currlocdata.mon_grouping[i]); @@ -5356,7 +5344,7 @@ PHP_FUNCTION(str_split) return; } - array_init_size(return_value, ((str->len - 1) / split_length) + 1); + array_init_size(return_value, (uint32_t)(((str->len - 1) / split_length) + 1)); n_reg_segments = str->len / split_length; p = str->val; diff --git a/ext/standard/tests/array/array_keys_on_GLOBALS.phpt b/ext/standard/tests/array/array_keys_on_GLOBALS.phpt new file mode 100644 index 0000000000..1d14ff4d53 --- /dev/null +++ b/ext/standard/tests/array/array_keys_on_GLOBALS.phpt @@ -0,0 +1,12 @@ +--TEST-- +Using array_keys() on $GLOBALS +--FILE-- +<?php + +$foo = 'bar'; +unset($foo); +var_dump(in_array('foo', array_keys($GLOBALS))); + +?> +--EXPECT-- +bool(false) diff --git a/ext/standard/tests/file/bug52820.phpt b/ext/standard/tests/file/bug52820.phpt index 3a9f9c31a4..a00ebf50b6 100644 --- a/ext/standard/tests/file/bug52820.phpt +++ b/ext/standard/tests/file/bug52820.phpt @@ -1,71 +1,63 @@ ---TEST--
-Bug #52820 (writes to fopencookie FILE* not committed when seeking the stream)
---SKIPIF--
-<?php
-if (!function_exists('leak_variable'))
- die("skip only for debug builds");
-/* unfortunately no standard function does a cast to FILE*, so we need
- * curl to test this */
-if (!extension_loaded("curl")) exit("skip curl extension not loaded");
-$handle=curl_init('http://127.0.0.1:37349/');
-curl_setopt($handle, CURLOPT_VERBOSE, true);
-curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
-if (!curl_setopt($handle, CURLOPT_STDERR, fopen("php://memory", "w+")))
- die("skip fopencookie not supported on this platform");
---FILE--
-<?php
-function do_stuff($url) {
- $handle=curl_init('http://127.0.0.1:37349/');
- curl_setopt($handle, CURLOPT_VERBOSE, true);
- curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($handle, CURLOPT_STDERR, $o = fopen($url, "w+"));
- curl_exec($handle);
- echo "About to rewind!\n";
- rewind($o);
- echo stream_get_contents($o);
- return $o;
-}
-
-echo "temp stream (close after):\n";
-fclose(do_stuff("php://temp"));
-
-echo "\nmemory stream (close after):\n";
-fclose(do_stuff("php://memory"));
-
-echo "\ntemp stream (leak):\n";
-leak_variable(do_stuff("php://temp"), true);
-
-echo "\nmemory stream (leak):\n";
-leak_variable(do_stuff("php://memory"), true);
-
-echo "\nDone.\n";
---EXPECTF--
-temp stream (close after):
-About to rewind!
-* About to connect() to 127.0.0.1 port 37349%r.*%r
-* Trying 127.0.0.1...%A* Connection refused
-* couldn't connect to host%S
-* Closing connection #0
-
-memory stream (close after):
-About to rewind!
-* About to connect() to 127.0.0.1 port 37349%r.*%r
-* Trying 127.0.0.1...%A* Connection refused
-* couldn't connect to host%S
-* Closing connection #0
-
-temp stream (leak):
-About to rewind!
-* About to connect() to 127.0.0.1 port 37349%r.*%r
-* Trying 127.0.0.1...%A* Connection refused
-* couldn't connect to host%S
-* Closing connection #0
-
-memory stream (leak):
-About to rewind!
-* About to connect() to 127.0.0.1 port 37349%r.*%r
-* Trying 127.0.0.1...%A* Connection refused
-* couldn't connect to host%S
-* Closing connection #0
-
-Done.
+--TEST-- +Bug #52820 (writes to fopencookie FILE* not committed when seeking the stream) +--SKIPIF-- +<?php +if (!function_exists('leak_variable')) + die("skip only for debug builds"); +/* unfortunately no standard function does a cast to FILE*, so we need + * curl to test this */ +if (!extension_loaded("curl")) exit("skip curl extension not loaded"); +$handle=curl_init('http://127.0.0.1:37349/'); +curl_setopt($handle, CURLOPT_VERBOSE, true); +curl_setopt($handle, CURLOPT_RETURNTRANSFER, true); +if (!curl_setopt($handle, CURLOPT_STDERR, fopen("php://memory", "w+"))) + die("skip fopencookie not supported on this platform"); +--FILE-- +<?php +function do_stuff($url) { + $handle=curl_init('http://127.0.0.1:37349/'); + curl_setopt($handle, CURLOPT_VERBOSE, true); + curl_setopt($handle, CURLOPT_RETURNTRANSFER, true); + curl_setopt($handle, CURLOPT_STDERR, $o = fopen($url, "w+")); + curl_exec($handle); + echo "About to rewind!\n"; + rewind($o); + echo stream_get_contents($o); + return $o; +} + +echo "temp stream (close after):\n"; +fclose(do_stuff("php://temp")); + +echo "\nmemory stream (close after):\n"; +fclose(do_stuff("php://memory")); + +echo "\ntemp stream (leak):\n"; +leak_variable(do_stuff("php://temp"), true); + +echo "\nmemory stream (leak):\n"; +leak_variable(do_stuff("php://memory"), true); + +echo "\nDone.\n"; +--EXPECTF-- +temp stream (close after): +About to rewind! +* %ATrying 127.0.0.1...%AConnection refused%A +* Closing connection%A%d + +memory stream (close after): +About to rewind! +* %ATrying 127.0.0.1...%AConnection refused%A +* Closing connection%A%d + +temp stream (leak): +About to rewind! +* %ATrying 127.0.0.1...%AConnection refused%A +* Closing connection%A%d + +memory stream (leak): +About to rewind! +* %ATrying 127.0.0.1...%AConnection refused%A +* Closing connection%A%d + +Done. diff --git a/ext/standard/tests/file/realpath_cache_win32.phpt b/ext/standard/tests/file/realpath_cache_win32.phpt index a4c663f6d1..e74a6565a7 100644 --- a/ext/standard/tests/file/realpath_cache_win32.phpt +++ b/ext/standard/tests/file/realpath_cache_win32.phpt @@ -19,7 +19,7 @@ echo "Done\n"; int(%d) array(8) { ["key"]=> - %s(%d) + %s(%d%s) ["is_dir"]=> bool(true) ["realpath"]=> diff --git a/ext/standard/tests/serialize/bug68044.phpt b/ext/standard/tests/serialize/bug68044.phpt new file mode 100644 index 0000000000..f8ef937b1e --- /dev/null +++ b/ext/standard/tests/serialize/bug68044.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #68044 Integer overflow in unserialize() (32-bits only) +--FILE-- +<?php + echo unserialize('C:3:"XYZ":18446744075857035259:{}'); +?> +===DONE== +--EXPECTF-- +Warning: Insufficient data for unserializing - %d required, 1 present in %s%ebug68044.php on line 2 + +Notice: unserialize(): Error at offset 32 of 33 bytes in %s%ebug68044.php on line 2 +===DONE== diff --git a/ext/standard/tests/serialize/counting_of_references.phpt b/ext/standard/tests/serialize/counting_of_references.phpt new file mode 100644 index 0000000000..e7ead96759 --- /dev/null +++ b/ext/standard/tests/serialize/counting_of_references.phpt @@ -0,0 +1,14 @@ +--TEST-- +References are not counted twice +--FILE-- +<?php + +$ref1 = 1; +$ref2 = 2; + +$arr = [&$ref1, &$ref1, &$ref2, &$ref2]; +var_dump(serialize($arr)); + +?> +--EXPECT-- +string(38) "a:4:{i:0;i:1;i:1;R:2;i:2;i:2;i:3;R:3;}" diff --git a/ext/standard/tests/streams/proc_open_bug51800.phpt b/ext/standard/tests/streams/proc_open_bug51800.phpt new file mode 100644 index 0000000000..53cafd8555 --- /dev/null +++ b/ext/standard/tests/streams/proc_open_bug51800.phpt @@ -0,0 +1,95 @@ +--TEST-- +Bug #51800 proc_open on Windows hangs forever +--SKIPIF-- +<?php + echo 'skip expected to fail or take too long'; + if (getenv("SKIP_SLOW_TESTS")) { + die("skip slow test"); + } +?> +--XFAIL-- +pipes have to be read/written simultaneously +--FILE-- +<?php +/* This is the wrong way to do it. The parent will block till it has read all the STDIN. +The smaller the pipe buffer is, the longer it will take. It might even pass at the end, +after taking inappropriately long. Pipes have to be read simultaneously in smaller chunks, +so then the pipe buffer is emptied more often and the child has chance to continue its +write. The behaviour might look some better if write/read in a separate thread, however +this is much more resource greedy and complexer to integrate into the user script. */ + +$callee = dirname(__FILE__) . "/process_proc_open_bug51800.php"; +$php = PHP_BINARY; +$cmd = "$php $callee"; + +$status; +$stdout = ""; +$stderr = ""; +$pipes = array(); + +$descriptors = array( + 0 => array("pipe", "rb"), // stdin + 1 => array("pipe", "wb"), // stdout + 2 => array("pipe", "wb") // stderr + ); + +/* create the proc file */ +$r = file_put_contents($callee, '<?php + +$how_much = 10000; + +$data0 = str_repeat("a", $how_much); +$data1 = str_repeat("b", $how_much); +fwrite(STDOUT, $data0); +fwrite(STDERR, $data1); + +exit(0); +'); + +if (!$r) { + die("couldn't create helper script '$callee'"); +} + +$process = proc_open($cmd, $descriptors, $pipes); + +if (is_resource($process)) +{ + fclose($pipes[0]); + + while (!feof($pipes[1])) + $stdout .= fread($pipes[1], 1024); + fclose($pipes[1]); + + while (!feof($pipes[2])) + $stderr .= fread($pipes[2], 1024); + fclose($pipes[2]); + + $status = proc_close($process); +} + +var_dump(array( + "status" => $status, + "stdout" => $stdout, + "stderr" => $stderr, +), strlen($stdout), strlen($stderr)); + +?> +===DONE=== +--CLEAN-- +<?php +$callee = dirname(__FILE__) . "/process_proc_open_bug51800.php"; +unlink($callee); +?> +--EXPECTF-- +array(3) { + ["status"]=> + int(0) + ["stdout"]=> + string(10000) "a%s" + ["stderr"]=> + string(10000) "b%s" +} +int(10000) +int(10000) +===DONE=== + diff --git a/ext/standard/tests/streams/proc_open_bug51800_right.phpt b/ext/standard/tests/streams/proc_open_bug51800_right.phpt new file mode 100644 index 0000000000..b14fed2e5d --- /dev/null +++ b/ext/standard/tests/streams/proc_open_bug51800_right.phpt @@ -0,0 +1,78 @@ +--TEST-- +Bug #51800 proc_open on Windows hangs forever, the right way to do it +--FILE-- +<?php +$callee = dirname(__FILE__) . "/process_proc_open_bug51800_right.php"; +$php = PHP_BINARY; +$cmd = "$php $callee"; + +$status; +$stdout = ""; +$stderr = ""; +$pipes = array(); + +$descriptors = array( + 0 => array("pipe", "rb"), // stdin + 1 => array("pipe", "wb"), // stdout + 2 => array("pipe", "wb") // stderr + ); + +/* create the proc file */ +$r = file_put_contents($callee, '<?php + +$how_much = 10000; + +$data0 = str_repeat("a", $how_much); +$data1 = str_repeat("b", $how_much); +fwrite(STDOUT, $data0); +fwrite(STDERR, $data1); + +exit(0); +'); + +if (!$r) { + die("couldn't create helper script '$callee'"); +} + +$process = proc_open($cmd, $descriptors, $pipes); + +if (is_resource($process)) +{ + fclose($pipes[0]); + + while (!feof($pipes[1]) || !feof($pipes[2])) { + $stdout .= fread($pipes[1], 1024); + $stderr .= fread($pipes[2], 1024); + } + fclose($pipes[1]); + fclose($pipes[2]); + + $status = proc_close($process); +} + +var_dump(array( + "status" => $status, + "stdout" => $stdout, + "stderr" => $stderr, +), strlen($stdout), strlen($stderr)); + +?> +===DONE=== +--CLEAN-- +<?php +$callee = dirname(__FILE__) . "/process_proc_open_bug51800_right.php"; +unlink($callee); +?> +--EXPECTF-- +array(3) { + ["status"]=> + int(0) + ["stdout"]=> + string(10000) "a%s" + ["stderr"]=> + string(10000) "b%s" +} +int(10000) +int(10000) +===DONE=== + diff --git a/ext/standard/tests/streams/proc_open_bug51800_right2.phpt b/ext/standard/tests/streams/proc_open_bug51800_right2.phpt new file mode 100644 index 0000000000..1e742745c1 --- /dev/null +++ b/ext/standard/tests/streams/proc_open_bug51800_right2.phpt @@ -0,0 +1,84 @@ +--TEST-- +Bug #51800 proc_open on Windows hangs forever, the right way to do it with more data +--FILE-- +<?php +$callee = dirname(__FILE__) . "/process_proc_open_bug51800_right2.php"; +$php = PHP_BINARY; +$cmd = "$php $callee"; + +$status; +$stdout = ""; +$stderr = ""; +$pipes = array(); + +$descriptors = array( + 0 => array("pipe", "rb"), // stdin + 1 => array("pipe", "wb"), // stdout + 2 => array("pipe", "wb") // stderr + ); + +/* create the proc file */ +$r = file_put_contents($callee, '<?php +$how_much = 1000000; + +$data0 = str_repeat("a", $how_much); +$data1 = str_repeat("b", $how_much); +$i0 = $i1 = 0; +$step = 1024; + +while ($i0 < strlen($data0) && $i1 < strlen($data1)) { + fwrite(STDOUT, substr($data0, $i0, $step)); + fwrite(STDERR, substr($data1, $i1, $step)); + $i0 += $step; + $i1 += $step; +} + +exit(0); +'); + +if (!$r) { + die("couldn't create helper script '$callee'"); +} + +$process = proc_open($cmd, $descriptors, $pipes); + +if (is_resource($process)) +{ + fclose($pipes[0]); + + while (!feof($pipes[1]) || !feof($pipes[2])) { + $stdout .= fread($pipes[1], 1024); + $stderr .= fread($pipes[2], 1024); + } + fclose($pipes[1]); + fclose($pipes[2]); + + $status = proc_close($process); +} + +var_dump(array( + "status" => $status, + "stdout" => $stdout, + "stderr" => $stderr, +), strlen($stdout), strlen($stderr)); + +?> +===DONE=== +--CLEAN-- +<?php +$callee = dirname(__FILE__) . "/process_proc_open_bug51800_right2.php"; +unlink($callee); +?> +--EXPECTF-- +array(3) { + ["status"]=> + int(0) + ["stdout"]=> + string(1000000) "a%s" + ["stderr"]=> + string(1000000) "b%s" +} +int(1000000) +int(1000000) +===DONE=== + diff --git a/ext/standard/tests/streams/proc_open_bug60120.phpt b/ext/standard/tests/streams/proc_open_bug60120.phpt new file mode 100644 index 0000000000..8768257a2e --- /dev/null +++ b/ext/standard/tests/streams/proc_open_bug60120.phpt @@ -0,0 +1,71 @@ +--TEST-- +Bug #60120 proc_open hangs with stdin/out with 2048+ bytes +--FILE-- +<?php +error_reporting(E_ALL); + +if (substr(PHP_OS, 0, 3) == 'WIN') { + $cmd = PHP_BINARY . ' -n -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"'; +} else { + $cmd = PHP_BINARY . ' -n -r \'fwrite(STDOUT, $in = file_get_contents("php://stdin")); fwrite(STDERR, $in);\''; +} +$descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w')); +$stdin = str_repeat('*', 1024 * 16) . '!'; +$stdin = str_repeat('*', 2049 ); + +$options = array_merge(array('suppress_errors' => true, 'binary_pipes' => true, 'bypass_shell' => false)); +$process = proc_open($cmd, $descriptors, $pipes, getcwd(), array(), $options); + +foreach ($pipes as $pipe) { + stream_set_blocking($pipe, false); +} +$writePipes = array($pipes[0]); +$stdinLen = strlen($stdin); +$stdinOffset = 0; + +unset($pipes[0]); + +while ($pipes || $writePipes) { + $r = $pipes; + $w = $writePipes; + $e = null; + $n = stream_select($r, $w, $e, 60); + + if (false === $n) { + break; + } elseif ($n === 0) { + proc_terminate($process); + + } + if ($w) { + $written = fwrite($writePipes[0], (binary)substr($stdin, $stdinOffset), 8192); + if (false !== $written) { + $stdinOffset += $written; + } + if ($stdinOffset >= $stdinLen) { + fclose($writePipes[0]); + $writePipes = null; + } + } + + foreach ($r as $pipe) { + $type = array_search($pipe, $pipes); + $data = fread($pipe, 8192); + var_dump($data); + if (false === $data || feof($pipe)) { + fclose($pipe); + unset($pipes[$type]); + } + } +} + + +?> +===DONE=== +--EXPECTF-- +string(2049) "%s" +string(2049) "%s" +string(0) "" +string(0) "" +===DONE=== + diff --git a/ext/standard/tests/streams/proc_open_bug64438.phpt b/ext/standard/tests/streams/proc_open_bug64438.phpt new file mode 100644 index 0000000000..b3857d09d4 --- /dev/null +++ b/ext/standard/tests/streams/proc_open_bug64438.phpt @@ -0,0 +1,70 @@ +--TEST-- +Bug #64438 proc_open hangs with stdin/out with 4097+ bytes +--FILE-- +<?php + +error_reporting(E_ALL); + +if (substr(PHP_OS, 0, 3) == 'WIN') { + $cmd = PHP_BINARY . ' -n -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"'; +} else { + $cmd = PHP_BINARY . ' -n -r \'fwrite(STDOUT, $in = file_get_contents("php://stdin")); fwrite(STDERR, $in);\''; +} +$descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w')); +$stdin = str_repeat('*', 4097); + +$options = array_merge(array('suppress_errors' => true, 'binary_pipes' => true, 'bypass_shell' => false)); +$process = proc_open($cmd, $descriptors, $pipes, getcwd(), array(), $options); + +foreach ($pipes as $pipe) { + stream_set_blocking($pipe, false); +} +$writePipes = array($pipes[0]); +$stdinLen = strlen($stdin); +$stdinOffset = 0; + +unset($pipes[0]); + +while ($pipes || $writePipes) { + $r = $pipes; + $w = $writePipes; + $e = null; + $n = stream_select($r, $w, $e, 60); + + if (false === $n) { + break; + } elseif ($n === 0) { + proc_terminate($process); + + } + if ($w) { + $written = fwrite($writePipes[0], (binary)substr($stdin, $stdinOffset), 8192); + if (false !== $written) { + $stdinOffset += $written; + } + if ($stdinOffset >= $stdinLen) { + fclose($writePipes[0]); + $writePipes = null; + } + } + + foreach ($r as $pipe) { + $type = array_search($pipe, $pipes); + $data = fread($pipe, 8192); + var_dump($data); + if (false === $data || feof($pipe)) { + fclose($pipe); + unset($pipes[$type]); + } + } +} + +?> +===DONE=== +--EXPECTF-- +string(4097) "%s" +string(4097) "%s" +string(0) "" +string(0) "" +===DONE=== + diff --git a/ext/standard/tests/strings/pack64.phpt b/ext/standard/tests/strings/pack64.phpt new file mode 100644 index 0000000000..9bc24928fe --- /dev/null +++ b/ext/standard/tests/strings/pack64.phpt @@ -0,0 +1,115 @@ +--TEST-- +64bit pack()/unpack() tests +--SKIPIF-- +<?php +if (PHP_INT_SIZE < 8) { + die("skip 64bit test only"); +} +?> +--FILE-- +<?php +print_r(unpack("Q", pack("Q", 0xfffffffffffe))); +print_r(unpack("Q", pack("Q", 0))); +print_r(unpack("Q", pack("Q", 0x8000000000000002))); +print_r(unpack("Q", pack("Q", -1))); +print_r(unpack("Q", pack("Q", 0x8000000000000000))); + +print_r(unpack("J", pack("J", 0xfffffffffffe))); +print_r(unpack("J", pack("J", 0))); +print_r(unpack("J", pack("J", 0x8000000000000002))); +print_r(unpack("J", pack("J", -1))); +print_r(unpack("J", pack("J", 0x8000000000000000))); + +print_r(unpack("P", pack("P", 0xfffffffffffe))); +print_r(unpack("P", pack("P", 0))); +print_r(unpack("P", pack("P", 0x8000000000000002))); +print_r(unpack("P", pack("P", -1))); +print_r(unpack("P", pack("P", 0x8000000000000000))); + +print_r(unpack("q", pack("q", 0xfffffffffffe))); +print_r(unpack("q", pack("q", 0))); +print_r(unpack("q", pack("q", 0x8000000000000002))); +print_r(unpack("q", pack("q", -1))); +print_r(unpack("q", pack("q", 0x8000000000000000))); +?> +--EXPECTF-- +Array +( + [1] => 281474976710654 +) +Array +( + [1] => 0 +) +Array +( + [1] => -9223372036854775808 +) +Array +( + [1] => -1 +) +Array +( + [1] => -9223372036854775808 +) +Array +( + [1] => 281474976710654 +) +Array +( + [1] => 0 +) +Array +( + [1] => -9223372036854775808 +) +Array +( + [1] => -1 +) +Array +( + [1] => -9223372036854775808 +) +Array +( + [1] => 281474976710654 +) +Array +( + [1] => 0 +) +Array +( + [1] => -9223372036854775808 +) +Array +( + [1] => -1 +) +Array +( + [1] => -9223372036854775808 +) +Array +( + [1] => 281474976710654 +) +Array +( + [1] => 0 +) +Array +( + [1] => -9223372036854775808 +) +Array +( + [1] => -1 +) +Array +( + [1] => -9223372036854775808 +) diff --git a/ext/standard/tests/strings/pack64_32.phpt b/ext/standard/tests/strings/pack64_32.phpt new file mode 100644 index 0000000000..f52de63ca4 --- /dev/null +++ b/ext/standard/tests/strings/pack64_32.phpt @@ -0,0 +1,44 @@ +--TEST-- +64bit pack()/unpack() tests +--SKIPIF-- +<?php +if (PHP_INT_SIZE > 4) { + die("skip 32bit test only"); +} +?> +--FILE-- +<?php +var_dump(pack("Q", 0)); +var_dump(pack("J", 0)); +var_dump(pack("P", 0)); +var_dump(pack("q", 0)); + +var_dump(unpack("Q", '')); +var_dump(unpack("J", '')); +var_dump(unpack("P", '')); +var_dump(unpack("q", '')); +?> +--EXPECTF-- +Warning: pack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d +bool(false) + +Warning: pack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d +bool(false) + +Warning: pack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d +bool(false) + +Warning: pack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d +bool(false) + +Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d +bool(false) + +Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d +bool(false) + +Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d +bool(false) + +Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d +bool(false) diff --git a/ext/standard/tests/strings/setlocale_variation2.phpt b/ext/standard/tests/strings/setlocale_variation2.phpt index 10ae22fe0c..5ebdfe8d50 100644 --- a/ext/standard/tests/strings/setlocale_variation2.phpt +++ b/ext/standard/tests/strings/setlocale_variation2.phpt @@ -20,9 +20,9 @@ echo "*** Testing setlocale() : usage variations ***\n"; function good_locale($locale) { /** - * Note: no_NO is a bogus locale and should not be used, see https://bugzilla.redhat.com/show_bug.cgi?id=532487 + * Note: no_NO is a bogus locale and should not be used, see https://bugzilla.redhat.com/971416 **/ - return $locale !== 'tt_RU@iqtelif.UTF-8' && substr($locale, 0, 5) !== "no_NO"; + return $locale !== 'tt_RU@iqtelif.UTF-8' && $locale !== 'no_NO.ISO-8859-1'; } /* Prototype : array list_system_locales( void ) diff --git a/ext/standard/tests/strings/url_t.phpt b/ext/standard/tests/strings/url_t.phpt index e0e5411036..e172061ec2 100644 --- a/ext/standard/tests/strings/url_t.phpt +++ b/ext/standard/tests/strings/url_t.phpt @@ -75,6 +75,7 @@ $sample_urls = array ( ); foreach ($sample_urls as $url) { + echo "\n--> $url: "; var_dump(@parse_url($url)); } @@ -84,21 +85,24 @@ $sample_urls = array ( } ?> --EXPECT-- -array(1) { +--> : array(1) { ["path"]=> string(0) "" } -array(1) { + +--> 64.246.30.37: array(1) { ["path"]=> string(12) "64.246.30.37" } -array(2) { + +--> http://64.246.30.37: array(2) { ["scheme"]=> string(4) "http" ["host"]=> string(12) "64.246.30.37" } -array(3) { + +--> http://64.246.30.37/: array(3) { ["scheme"]=> string(4) "http" ["host"]=> @@ -106,11 +110,13 @@ array(3) { ["path"]=> string(1) "/" } -array(1) { + +--> 64.246.30.37/: array(1) { ["path"]=> string(13) "64.246.30.37/" } -array(3) { + +--> 64.246.30.37:80/: array(3) { ["host"]=> string(12) "64.246.30.37" ["port"]=> @@ -118,21 +124,25 @@ array(3) { ["path"]=> string(1) "/" } -array(1) { + +--> php.net: array(1) { ["path"]=> string(7) "php.net" } -array(1) { + +--> php.net/: array(1) { ["path"]=> string(8) "php.net/" } -array(2) { + +--> http://php.net: array(2) { ["scheme"]=> string(4) "http" ["host"]=> string(7) "php.net" } -array(3) { + +--> http://php.net/: array(3) { ["scheme"]=> string(4) "http" ["host"]=> @@ -140,21 +150,25 @@ array(3) { ["path"]=> string(1) "/" } -array(1) { + +--> www.php.net: array(1) { ["path"]=> string(11) "www.php.net" } -array(1) { + +--> www.php.net/: array(1) { ["path"]=> string(12) "www.php.net/" } -array(2) { + +--> http://www.php.net: array(2) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" } -array(3) { + +--> http://www.php.net/: array(3) { ["scheme"]=> string(4) "http" ["host"]=> @@ -162,13 +176,15 @@ array(3) { ["path"]=> string(1) "/" } -array(2) { + +--> www.php.net:80: array(2) { ["host"]=> string(11) "www.php.net" ["port"]=> int(80) } -array(3) { + +--> http://www.php.net:80: array(3) { ["scheme"]=> string(4) "http" ["host"]=> @@ -176,7 +192,8 @@ array(3) { ["port"]=> int(80) } -array(4) { + +--> http://www.php.net:80/: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -186,7 +203,8 @@ array(4) { ["path"]=> string(1) "/" } -array(3) { + +--> http://www.php.net/index.php: array(3) { ["scheme"]=> string(4) "http" ["host"]=> @@ -194,11 +212,13 @@ array(3) { ["path"]=> string(10) "/index.php" } -array(1) { + +--> www.php.net/?: array(1) { ["path"]=> string(12) "www.php.net/" } -array(3) { + +--> www.php.net:80/?: array(3) { ["host"]=> string(11) "www.php.net" ["port"]=> @@ -206,7 +226,8 @@ array(3) { ["path"]=> string(1) "/" } -array(3) { + +--> http://www.php.net/?: array(3) { ["scheme"]=> string(4) "http" ["host"]=> @@ -214,7 +235,8 @@ array(3) { ["path"]=> string(1) "/" } -array(4) { + +--> http://www.php.net:80/?: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -224,7 +246,8 @@ array(4) { ["path"]=> string(1) "/" } -array(4) { + +--> http://www.php.net:80/index.php: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -234,7 +257,8 @@ array(4) { ["path"]=> string(10) "/index.php" } -array(4) { + +--> http://www.php.net:80/foo/bar/index.php: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -244,7 +268,8 @@ array(4) { ["path"]=> string(18) "/foo/bar/index.php" } -array(4) { + +--> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -254,7 +279,8 @@ array(4) { ["path"]=> string(53) "/this/is/a/very/deep/directory/structure/and/file.php" } -array(5) { + +--> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2¶meters=3&too=4&here=5: array(5) { ["scheme"]=> string(4) "http" ["host"]=> @@ -266,7 +292,8 @@ array(5) { ["query"]=> string(37) "lots=1&of=2¶meters=3&too=4&here=5" } -array(4) { + +--> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -276,7 +303,8 @@ array(4) { ["path"]=> string(45) "/this/is/a/very/deep/directory/structure/and/" } -array(4) { + +--> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -286,7 +314,8 @@ array(4) { ["path"]=> string(53) "/this/is/a/very/deep/directory/structure/and/file.php" } -array(4) { + +--> http://www.php.net:80/this/../a/../deep/directory: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -296,7 +325,8 @@ array(4) { ["path"]=> string(28) "/this/../a/../deep/directory" } -array(4) { + +--> http://www.php.net:80/this/../a/../deep/directory/: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -306,7 +336,8 @@ array(4) { ["path"]=> string(29) "/this/../a/../deep/directory/" } -array(4) { + +--> http://www.php.net:80/this/is/a/very/deep/directory/../file.php: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -316,7 +347,8 @@ array(4) { ["path"]=> string(42) "/this/is/a/very/deep/directory/../file.php" } -array(4) { + +--> http://www.php.net:80/index.php: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -326,7 +358,8 @@ array(4) { ["path"]=> string(10) "/index.php" } -array(4) { + +--> http://www.php.net:80/index.php?: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -336,7 +369,8 @@ array(4) { ["path"]=> string(10) "/index.php" } -array(5) { + +--> http://www.php.net:80/#foo: array(5) { ["scheme"]=> string(4) "http" ["host"]=> @@ -348,7 +382,8 @@ array(5) { ["fragment"]=> string(3) "foo" } -array(4) { + +--> http://www.php.net:80/?#: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -358,7 +393,8 @@ array(4) { ["path"]=> string(1) "/" } -array(5) { + +--> http://www.php.net:80/?test=1: array(5) { ["scheme"]=> string(4) "http" ["host"]=> @@ -370,7 +406,8 @@ array(5) { ["query"]=> string(6) "test=1" } -array(4) { + +--> http://www.php.net/?test=1&: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -380,7 +417,8 @@ array(4) { ["query"]=> string(7) "test=1&" } -array(5) { + +--> http://www.php.net:80/?&: array(5) { ["scheme"]=> string(4) "http" ["host"]=> @@ -392,7 +430,8 @@ array(5) { ["query"]=> string(1) "&" } -array(5) { + +--> http://www.php.net:80/index.php?test=1&: array(5) { ["scheme"]=> string(4) "http" ["host"]=> @@ -404,7 +443,8 @@ array(5) { ["query"]=> string(7) "test=1&" } -array(4) { + +--> http://www.php.net/index.php?&: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -414,7 +454,8 @@ array(4) { ["query"]=> string(1) "&" } -array(5) { + +--> http://www.php.net:80/index.php?foo&: array(5) { ["scheme"]=> string(4) "http" ["host"]=> @@ -426,7 +467,8 @@ array(5) { ["query"]=> string(4) "foo&" } -array(4) { + +--> http://www.php.net/index.php?&foo: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -436,7 +478,8 @@ array(4) { ["query"]=> string(4) "&foo" } -array(5) { + +--> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI: array(5) { ["scheme"]=> string(4) "http" ["host"]=> @@ -448,7 +491,8 @@ array(5) { ["query"]=> string(31) "test=1&test2=char&test3=mixesCI" } -array(5) { + +--> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(5) { ["host"]=> string(11) "www.php.net" ["port"]=> @@ -460,7 +504,8 @@ array(5) { ["fragment"]=> string(16) "some_page_ref123" } -array(7) { + +--> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { ["scheme"]=> string(4) "http" ["host"]=> @@ -476,13 +521,16 @@ array(7) { ["fragment"]=> string(16) "some_page_ref123" } -array(6) { + +--> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["user"]=> string(6) "secret" + ["pass"]=> + string(0) "" ["path"]=> string(10) "/index.php" ["query"]=> @@ -490,13 +538,16 @@ array(6) { ["fragment"]=> string(16) "some_page_ref123" } -array(7) { + +--> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) + ["user"]=> + string(0) "" ["pass"]=> string(7) "hideout" ["path"]=> @@ -506,7 +557,8 @@ array(7) { ["fragment"]=> string(16) "some_page_ref123" } -array(7) { + +--> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { ["scheme"]=> string(4) "http" ["host"]=> @@ -522,7 +574,8 @@ array(7) { ["fragment"]=> string(16) "some_page_ref123" } -array(7) { + +--> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { ["scheme"]=> string(4) "http" ["host"]=> @@ -538,7 +591,8 @@ array(7) { ["fragment"]=> string(16) "some_page_ref123" } -array(8) { + +--> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(8) { ["scheme"]=> string(4) "http" ["host"]=> @@ -556,13 +610,15 @@ array(8) { ["fragment"]=> string(16) "some_page_ref123" } -array(2) { + +--> nntp://news.php.net: array(2) { ["scheme"]=> string(4) "nntp" ["host"]=> string(12) "news.php.net" } -array(3) { + +--> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz: array(3) { ["scheme"]=> string(3) "ftp" ["host"]=> @@ -570,25 +626,29 @@ array(3) { ["path"]=> string(22) "/gnu/glic/glibc.tar.gz" } -array(2) { + +--> zlib:http://foo@bar: array(2) { ["scheme"]=> string(4) "zlib" ["path"]=> string(14) "http://foo@bar" } -array(2) { + +--> zlib:filename.txt: array(2) { ["scheme"]=> string(4) "zlib" ["path"]=> string(12) "filename.txt" } -array(2) { + +--> zlib:/path/to/my/file/file.txt: array(2) { ["scheme"]=> string(4) "zlib" ["path"]=> string(25) "/path/to/my/file/file.txt" } -array(3) { + +--> foo://foo@bar: array(3) { ["scheme"]=> string(3) "foo" ["host"]=> @@ -596,25 +656,29 @@ array(3) { ["user"]=> string(3) "foo" } -array(2) { + +--> mailto:me@mydomain.com: array(2) { ["scheme"]=> string(6) "mailto" ["path"]=> string(15) "me@mydomain.com" } -array(2) { + +--> /foo.php?a=b&c=d: array(2) { ["path"]=> string(8) "/foo.php" ["query"]=> string(7) "a=b&c=d" } -array(2) { + +--> foo.php?a=b&c=d: array(2) { ["path"]=> string(7) "foo.php" ["query"]=> string(7) "a=b&c=d" } -array(6) { + +--> http://user:passwd@www.example.com:8080?bar=1&boom=0: array(6) { ["scheme"]=> string(4) "http" ["host"]=> @@ -628,13 +692,15 @@ array(6) { ["query"]=> string(12) "bar=1&boom=0" } -array(2) { + +--> file:///path/to/file: array(2) { ["scheme"]=> string(4) "file" ["path"]=> string(13) "/path/to/file" } -array(3) { + +--> file://path/to/file: array(3) { ["scheme"]=> string(4) "file" ["host"]=> @@ -642,13 +708,15 @@ array(3) { ["path"]=> string(8) "/to/file" } -array(2) { + +--> file:/path/to/file: array(2) { ["scheme"]=> string(4) "file" ["path"]=> string(13) "/path/to/file" } -array(4) { + +--> http://1.2.3.4:/abc.asp?a=1&b=2: array(4) { ["scheme"]=> string(4) "http" ["host"]=> @@ -658,7 +726,8 @@ array(4) { ["query"]=> string(7) "a=1&b=2" } -array(3) { + +--> http://foo.com#bar: array(3) { ["scheme"]=> string(4) "http" ["host"]=> @@ -666,11 +735,13 @@ array(3) { ["fragment"]=> string(3) "bar" } -array(1) { + +--> scheme:: array(1) { ["scheme"]=> string(6) "scheme" } -array(4) { + +--> foo+bar://baz@bang/bla: array(4) { ["scheme"]=> string(7) "foo+bar" ["host"]=> @@ -680,13 +751,15 @@ array(4) { ["path"]=> string(4) "/bla" } -array(2) { + +--> gg:9130731: array(2) { ["scheme"]=> string(2) "gg" ["path"]=> string(7) "9130731" } -array(7) { + +--> http://user:@pass@host/path?argument?value#etc: array(7) { ["scheme"]=> string(4) "http" ["host"]=> @@ -710,3 +783,4 @@ string(7) "hideout" string(10) "/index.php" string(31) "test=1&test2=char&test3=mixesCI" string(16) "some_page_ref123" + diff --git a/ext/standard/tests/url/parse_url_basic_001.phpt b/ext/standard/tests/url/parse_url_basic_001.phpt index a6f4f7a252..0708691fe3 100644 --- a/ext/standard/tests/url/parse_url_basic_001.phpt +++ b/ext/standard/tests/url/parse_url_basic_001.phpt @@ -454,13 +454,15 @@ echo "Done"; string(16) "some_page_ref123" } ---> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(6) { +--> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["user"]=> string(6) "secret" + ["pass"]=> + string(0) "" ["path"]=> string(10) "/index.php" ["query"]=> @@ -469,13 +471,15 @@ echo "Done"; string(16) "some_page_ref123" } ---> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) { +--> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(8) { ["scheme"]=> string(4) "http" ["host"]=> string(11) "www.php.net" ["port"]=> int(80) + ["user"]=> + string(0) "" ["pass"]=> string(7) "hideout" ["path"]=> diff --git a/ext/standard/tests/url/parse_url_basic_005.phpt b/ext/standard/tests/url/parse_url_basic_005.phpt index 1fc946e5b3..5b2cb98f8b 100644 --- a/ext/standard/tests/url/parse_url_basic_005.phpt +++ b/ext/standard/tests/url/parse_url_basic_005.phpt @@ -66,7 +66,7 @@ echo "Done"; --> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL --> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret" --> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret" ---> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL +--> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(0) "" --> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret" --> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(14) "secret@hideout" --> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret" diff --git a/ext/standard/tests/url/parse_url_basic_006.phpt b/ext/standard/tests/url/parse_url_basic_006.phpt index 5104326198..79af6b8b62 100644 --- a/ext/standard/tests/url/parse_url_basic_006.phpt +++ b/ext/standard/tests/url/parse_url_basic_006.phpt @@ -65,7 +65,7 @@ echo "Done"; --> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : NULL --> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL --> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL ---> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL +--> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(0) "" --> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(7) "hideout" --> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(7) "hideout" --> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL diff --git a/ext/standard/type.c b/ext/standard/type.c index fa5cd4639e..a773e6c53c 100644 --- a/ext/standard/type.c +++ b/ext/standard/type.c @@ -156,7 +156,7 @@ PHP_FUNCTION(intval) #endif RETVAL_ZVAL(num, 1, 0); - convert_to_long_base(return_value, base); + convert_to_long_base(return_value, (int)base); } /* }}} */ @@ -219,12 +219,7 @@ static inline void php_is_type(INTERNAL_FUNCTION_PARAMETERS, int type) if (Z_TYPE_P(arg) == type) { if (type == IS_OBJECT) { - zend_class_entry *ce; - if (Z_OBJ_HT_P(arg)->get_class_entry == NULL) { - /* if there's no get_class_entry it's not a PHP object, so it can't be INCOMPLETE_CLASS */ - RETURN_TRUE; - } - ce = Z_OBJCE_P(arg); + zend_class_entry *ce = Z_OBJCE_P(arg); if (ce->name->len == sizeof(INCOMPLETE_CLASS) - 1 && !strncmp(ce->name->val, INCOMPLETE_CLASS, ce->name->len)) { RETURN_FALSE; diff --git a/ext/standard/url.c b/ext/standard/url.c index 81f9b2ac9a..7d408ef88a 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -61,7 +61,7 @@ PHPAPI void php_url_free(php_url *theurl) /* {{{ php_replace_controlchars */ -PHPAPI char *php_replace_controlchars_ex(char *str, int len) +PHPAPI char *php_replace_controlchars_ex(char *str, size_t len) { unsigned char *s = (unsigned char *)str; unsigned char *e = (unsigned char *)str + len; @@ -94,7 +94,7 @@ PHPAPI php_url *php_url_parse(char const *str) /* {{{ php_url_parse */ -PHPAPI php_url *php_url_parse_ex(char const *str, int length) +PHPAPI php_url *php_url_parse_ex(char const *str, size_t length) { char port_buf[6]; php_url *ret = ecalloc(1, sizeof(php_url)); @@ -240,16 +240,12 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length) /* check for login and password */ if ((p = zend_memrchr(s, '@', (e-s)))) { if ((pp = memchr(s, ':', (p-s)))) { - if ((pp-s) > 0) { - ret->user = estrndup(s, (pp-s)); - php_replace_controlchars_ex(ret->user, (pp - s)); - } + ret->user = estrndup(s, (pp-s)); + php_replace_controlchars_ex(ret->user, (pp - s)); pp++; - if (p-pp > 0) { - ret->pass = estrndup(pp, (p-pp)); - php_replace_controlchars_ex(ret->pass, (p-pp)); - } + ret->pass = estrndup(pp, (p-pp)); + php_replace_controlchars_ex(ret->pass, (p-pp)); } else { ret->user = estrndup(s, (p-s)); php_replace_controlchars_ex(ret->user, (p-s)); @@ -485,7 +481,7 @@ static unsigned char hexchars[] = "0123456789ABCDEF"; /* {{{ php_url_encode */ -PHPAPI zend_string *php_url_encode(char const *s, int len) +PHPAPI zend_string *php_url_encode(char const *s, size_t len) { register unsigned char c; unsigned char *to; @@ -576,7 +572,7 @@ PHP_FUNCTION(urldecode) /* {{{ php_url_decode */ -PHPAPI int php_url_decode(char *str, int len) +PHPAPI size_t php_url_decode(char *str, size_t len) { char *dest = str; char *data = str; @@ -607,7 +603,7 @@ PHPAPI int php_url_decode(char *str, int len) /* {{{ php_raw_url_encode */ -PHPAPI zend_string *php_raw_url_encode(char const *s, int len) +PHPAPI zend_string *php_raw_url_encode(char const *s, size_t len) { register int x, y; zend_string *str; @@ -683,7 +679,7 @@ PHP_FUNCTION(rawurldecode) /* {{{ php_raw_url_decode */ -PHPAPI int php_raw_url_decode(char *str, int len) +PHPAPI size_t php_raw_url_decode(char *str, size_t len) { char *dest = str; char *data = str; diff --git a/ext/standard/url.h b/ext/standard/url.h index 4d7a1f5b56..ec2676eaee 100644 --- a/ext/standard/url.h +++ b/ext/standard/url.h @@ -33,11 +33,12 @@ typedef struct php_url { PHPAPI void php_url_free(php_url *theurl); PHPAPI php_url *php_url_parse(char const *str); -PHPAPI php_url *php_url_parse_ex(char const *str, int length); -PHPAPI int php_url_decode(char *str, int len); /* return value: length of decoded string */ -PHPAPI int php_raw_url_decode(char *str, int len); /* return value: length of decoded string */ -PHPAPI zend_string *php_url_encode(char const *s, int len); -PHPAPI zend_string *php_raw_url_encode(char const *s, int len); +PHPAPI php_url *php_url_parse_ex(char const *str, size_t length); +PHPAPI size_t php_url_decode(char *str, size_t len); /* return value: length of decoded string */ +PHPAPI size_t php_raw_url_decode(char *str, size_t len); /* return value: length of decoded string */ +PHPAPI zend_string *php_url_encode(char const *s, size_t len); +PHPAPI zend_string *php_raw_url_encode(char const *s, size_t len); +PHPAPI char *php_replace_controlchars_ex(char *str, size_t len); PHP_FUNCTION(parse_url); PHP_FUNCTION(urlencode); diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c index 3d7aa985b8..6b406e673f 100644 --- a/ext/standard/url_scanner_ex.c +++ b/ext/standard/url_scanner_ex.c @@ -79,7 +79,7 @@ static PHP_INI_MH(OnUpdateTags) val = strchr(key, '='); if (val) { char *q; - int keylen; + size_t keylen; *val++ = '\0'; for (q = key; *q; q++) @@ -351,7 +351,7 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s char *end, *q; char *xp; char *start; - int rest; + size_t rest; smart_str_appendl(&ctx->buf, newdata, newlen); @@ -906,10 +906,13 @@ yy76: stop: - rest = YYLIMIT - start; - scdebug(("stopped in state %d at pos %d (%d:%c) %d\n", STATE, YYCURSOR - ctx->buf.c, *YYCURSOR, *YYCURSOR, rest)); - /* XXX: Crash avoidance. Need to work with reporter to figure out what goes wrong */ - if (rest < 0) rest = 0; + if (YYLIMIT < start) { + /* XXX: Crash avoidance. Need to work with reporter to figure out what goes wrong */ + rest = 0; + } else { + rest = YYLIMIT - start; + scdebug(("stopped in state %d at pos %d (%d:%c) %d\n", STATE, YYCURSOR - ctx->buf.c, *YYCURSOR, *YYCURSOR, rest)); + } if (rest) memmove(ctx->buf.s->val, start, rest); ctx->buf.s->len = rest; @@ -993,7 +996,7 @@ static int php_url_scanner_ex_deactivate(TSRMLS_D) return SUCCESS; } -static void php_url_scanner_output_handler(char *output, uint output_len, char **handled_output, uint *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 TSRMLS_DC) { size_t len; @@ -1023,7 +1026,7 @@ static void php_url_scanner_output_handler(char *output, uint output_len, char * } } -PHPAPI int php_url_scanner_add_var(char *name, int name_len, char *value, int 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 TSRMLS_DC) { smart_str val = {0}; zend_string *encoded; diff --git a/ext/standard/url_scanner_ex.h b/ext/standard/url_scanner_ex.h index 3c5b68c95b..2a9b6921bf 100644 --- a/ext/standard/url_scanner_ex.h +++ b/ext/standard/url_scanner_ex.h @@ -28,7 +28,7 @@ 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, int name_len, char *value, int 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 TSRMLS_DC); PHPAPI int php_url_scanner_reset_vars(TSRMLS_D); #include "zend_smart_str_public.h" diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re index 2e74b1fb30..fed628f089 100644 --- a/ext/standard/url_scanner_ex.re +++ b/ext/standard/url_scanner_ex.re @@ -77,7 +77,7 @@ static PHP_INI_MH(OnUpdateTags) val = strchr(key, '='); if (val) { char *q; - int keylen; + size_t keylen; *val++ = '\0'; for (q = key; *q; q++) @@ -287,7 +287,7 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s char *end, *q; char *xp; char *start; - int rest; + size_t rest; smart_str_appendl(&ctx->buf, newdata, newlen); @@ -358,10 +358,13 @@ state_val: */ stop: - rest = YYLIMIT - start; - scdebug(("stopped in state %d at pos %d (%d:%c) %d\n", STATE, YYCURSOR - ctx->buf.c, *YYCURSOR, *YYCURSOR, rest)); - /* XXX: Crash avoidance. Need to work with reporter to figure out what goes wrong */ - if (rest < 0) rest = 0; + if (YYLIMIT < start) { + /* XXX: Crash avoidance. Need to work with reporter to figure out what goes wrong */ + rest = 0; + } else { + rest = YYLIMIT - start; + scdebug(("stopped in state %d at pos %d (%d:%c) %d\n", STATE, YYCURSOR - ctx->buf.c, *YYCURSOR, *YYCURSOR, rest)); + } if (rest) memmove(ctx->buf.s->val, start, rest); ctx->buf.s->len = rest; @@ -445,7 +448,7 @@ static int php_url_scanner_ex_deactivate(TSRMLS_D) return SUCCESS; } -static void php_url_scanner_output_handler(char *output, uint output_len, char **handled_output, uint *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 TSRMLS_DC) { size_t len; @@ -475,7 +478,7 @@ static void php_url_scanner_output_handler(char *output, uint output_len, char * } } -PHPAPI int php_url_scanner_add_var(char *name, int name_len, char *value, int 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 TSRMLS_DC) { smart_str val = {0}; zend_string *encoded; diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c index 19e8e454df..f310e64ae9 100644 --- a/ext/standard/user_filters.c +++ b/ext/standard/user_filters.c @@ -221,7 +221,7 @@ php_stream_filter_status_t userfilter_filter( if (call_result == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { convert_to_long(&retval); - ret = Z_LVAL(retval); + ret = (int)Z_LVAL(retval); } else if (call_result == FAILURE) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to call filter function"); } @@ -287,7 +287,7 @@ static php_stream_filter *user_filter_factory_create(const char *filtername, return NULL; } - len = strlen(filtername); + len = (int)strlen(filtername); /* determine the classname/class entry */ if (NULL == (fdat = zend_hash_str_find_ptr(BG(user_filter_map), (char*)filtername, len))) { diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c index 6582e7de65..ea171a658a 100644 --- a/ext/standard/uuencode.c +++ b/ext/standard/uuencode.c @@ -83,7 +83,7 @@ PHPAPI zend_string *php_uuencode(char *src, size_t src_len) /* {{{ */ ee = e; len = ee - s; if (len % 3) { - ee = s + (int) (floor(len / 3) * 3); + ee = s + (int) (floor((double)len / 3) * 3); } } *p++ = PHP_UU_ENC(len); @@ -173,7 +173,8 @@ PHPAPI zend_string *php_uudecode(char *src, size_t src_len) /* {{{ */ s++; } - if ((len = total_len > (p - dest->val))) { + assert(p >= dest->val); + if ((len = total_len > (size_t)(p - dest->val))) { *p++ = PHP_UU_DEC(*s) << 2 | PHP_UU_DEC(*(s + 1)) >> 4; if (len > 1) { *p++ = PHP_UU_DEC(*(s + 1)) << 4 | PHP_UU_DEC(*(s + 2)) >> 2; diff --git a/ext/standard/var.c b/ext/standard/var.c index f9d897a4ec..4f0bd24bdc 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -163,13 +163,10 @@ again: return; } - if (Z_OBJ_HANDLER_P(struc, get_class_name)) { - class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc), 0 TSRMLS_CC); - 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); - } else { - php_printf("%sobject(unknown class)#%d (%d) {\n", COMMON, Z_OBJ_HANDLE_P(struc), myht ? zend_obj_num_elements(myht) : 0); - } + class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc) TSRMLS_CC); + 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); + if (myht) { zend_ulong num; zend_string *key; @@ -334,7 +331,7 @@ again: myht->u.v.nApplyCount++; } } - class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc), 0 TSRMLS_CC); + class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc) TSRMLS_CC); 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) { @@ -392,7 +389,7 @@ PHP_FUNCTION(debug_zval_dump) #define buffer_append_spaces(buf, num_spaces) \ do { \ char *tmp_spaces; \ - int tmp_spaces_len; \ + size_t tmp_spaces_len; \ tmp_spaces_len = spprintf(&tmp_spaces, 0,"%*c", num_spaces, ' '); \ smart_str_appendl(buf, tmp_spaces, tmp_spaces_len); \ efree(tmp_spaces); \ @@ -456,7 +453,6 @@ PHPAPI void php_var_export_ex(zval *struc, int level, smart_str *buf TSRMLS_DC) HashTable *myht; char *tmp_str; size_t tmp_len; - zend_string *class_name; zend_string *ztmp, *ztmp2; zend_ulong index; zend_string *key; @@ -533,12 +529,10 @@ again: smart_str_appendc(buf, '\n'); buffer_append_spaces(buf, level - 1); } - class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc), 0 TSRMLS_CC); - smart_str_append(buf, class_name); + smart_str_append(buf, Z_OBJCE_P(struc)->name); smart_str_appendl(buf, "::__set_state(array(\n", 21); - zend_string_release(class_name); if (myht) { ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, val) { php_object_element_export(val, index, key, level, buf TSRMLS_CC); @@ -598,54 +592,51 @@ PHP_FUNCTION(var_export) } /* }}} */ -static void php_var_serialize_intern(smart_str *buf, zval *struc, HashTable *var_hash TSRMLS_DC); +static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_data_t var_hash TSRMLS_DC); -static inline int php_add_var_hash(HashTable *var_hash, zval *var_ptr, zval *var_old TSRMLS_DC) /* {{{ */ +static inline zend_long php_add_var_hash(php_serialize_data_t data, zval *var TSRMLS_DC) /* {{{ */ { - zval var_no, *zv; - char id[32], *p; - register int len; - zval *var = var_ptr; + zval *zv; + zend_ulong key; + zend_bool is_ref = Z_ISREF_P(var); - if (Z_ISREF_P(var)) { - var = Z_REFVAL_P(var); + data->n += 1; + + if (!is_ref && Z_TYPE_P(var) != IS_OBJECT) { + return 0; } - if ((Z_TYPE_P(var) == IS_OBJECT) && Z_OBJ_HT_P(var)->get_class_entry) { - p = zend_print_long_to_buf(id + sizeof(id) - 1, - (zend_long) Z_OBJ_P(var)); - *(--p) = 'O'; - len = id + sizeof(id) - 1 - p; - } else if (var_ptr != var) { - p = zend_print_long_to_buf(id + sizeof(id) - 1, - (zend_long) Z_REF_P(var_ptr)); - *(--p) = 'R'; - len = id + sizeof(id) - 1 - p; - } else { - p = zend_print_long_to_buf(id + sizeof(id) - 1, (zend_long) var); - len = id + sizeof(id) - 1 - p; + + /* References to objects are treated as if the reference didn't exist */ + if (is_ref && Z_TYPE_P(Z_REFVAL_P(var)) == IS_OBJECT) { + var = Z_REFVAL_P(var); } - if ((zv = zend_hash_str_find(var_hash, p, len)) != NULL) { - ZVAL_COPY_VALUE(var_old, zv); - if (var == var_ptr) { - /* we still need to bump up the counter, since non-refs will - * be counted separately by unserializer */ - ZVAL_LONG(&var_no, -1); - zend_hash_next_index_insert(var_hash, &var_no); + /* Index for the variable is stored using the numeric value of the pointer to + * the zend_refcounted struct */ + key = (zend_ulong) (zend_uintptr_t) Z_COUNTED_P(var); + zv = zend_hash_index_find(&data->ht, key); + + if (zv) { + /* References are only counted once, undo the data->n increment above */ + if (is_ref) { + data->n -= 1; } -#if 0 - fprintf(stderr, "- had var (%d): %lu\n", Z_TYPE_P(var), **(zend_ulong**)var_old); -#endif - return FAILURE; - } - /* +1 because otherwise hash will think we are trying to store NULL pointer */ - ZVAL_LONG(&var_no, zend_hash_num_elements(var_hash) + 1); - zend_hash_str_add(var_hash, p, len, &var_no); -#if 0 - fprintf(stderr, "+ add var (%d): %lu\n", Z_TYPE_P(var), Z_LVAL(var_no)); -#endif - return SUCCESS; + return Z_LVAL_P(zv); + } else { + zval zv_n; + ZVAL_LONG(&zv_n, data->n); + zend_hash_index_add_new(&data->ht, key, &zv_n); + + /* Additionally to the index, we also store the variable, to ensure that it is + * not destroyed during serialization and its pointer reused. The variable is + * stored at the numeric value of the pointer + 1, which cannot be the location + * of another zend_refcounted structure. */ + zend_hash_index_add_new(&data->ht, key + 1, var); + Z_ADDREF_P(var); + + return 0; + } } /* }}} */ @@ -682,7 +673,7 @@ 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, HashTable *var_hash TSRMLS_DC) /* {{{ */ +static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_ptr, php_serialize_data_t var_hash TSRMLS_DC) /* {{{ */ { uint32_t count; zend_bool incomplete_class; @@ -730,8 +721,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); } else { - zend_class_entry *ce; - ce = zend_get_class_entry(Z_OBJ_P(struc) TSRMLS_CC); + zend_class_entry *ce = Z_OBJ_P(struc)->ce; if (ce) { zend_string *prot_name, *priv_name; @@ -780,27 +770,24 @@ 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, HashTable *var_hash TSRMLS_DC) /* {{{ */ +static void php_var_serialize_intern(smart_str *buf, zval *struc, php_serialize_data_t var_hash TSRMLS_DC) /* {{{ */ { - zval var_already; + zend_long var_already; HashTable *myht; if (EG(exception)) { return; } - ZVAL_UNDEF(&var_already); - - if (var_hash && - php_add_var_hash(var_hash, struc, &var_already TSRMLS_CC) == FAILURE) { + if (var_hash && (var_already = php_add_var_hash(var_hash, struc TSRMLS_CC))) { if (Z_ISREF_P(struc)) { smart_str_appendl(buf, "R:", 2); - smart_str_append_long(buf, Z_LVAL(var_already)); + smart_str_append_long(buf, var_already); smart_str_appendc(buf, ';'); return; } else if (Z_TYPE_P(struc) == IS_OBJECT) { smart_str_appendl(buf, "r:", 2); - smart_str_append_long(buf, Z_LVAL(var_already)); + smart_str_append_long(buf, var_already); smart_str_appendc(buf, ';'); return; } @@ -829,7 +816,7 @@ again: smart_str_appendl(buf, "d:", 2); s = (char *) safe_emalloc(PG(serialize_precision), 1, MAX_LENGTH_OF_DOUBLE + 1); - php_gcvt(Z_DVAL_P(struc), PG(serialize_precision), '.', 'E', s); + php_gcvt(Z_DVAL_P(struc), (int)PG(serialize_precision), '.', 'E', s); smart_str_appends(buf, s); smart_str_appendc(buf, ';'); efree(s); @@ -844,13 +831,9 @@ again: zval retval; zval fname; int res; - zend_class_entry *ce = NULL; - - if (Z_OBJ_HT_P(struc)->get_class_entry) { - ce = Z_OBJCE_P(struc); - } + zend_class_entry *ce = Z_OBJCE_P(struc); - if (ce && ce->serialize != NULL) { + if (ce->serialize != NULL) { /* has custom handler */ unsigned char *serialized_data = NULL; size_t serialized_length; @@ -971,9 +954,9 @@ again: } /* }}} */ -PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *var_hash TSRMLS_DC) /* {{{ */ +PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *data TSRMLS_DC) /* {{{ */ { - php_var_serialize_intern(buf, struc, *var_hash TSRMLS_CC); + php_var_serialize_intern(buf, struc, *data TSRMLS_CC); smart_str_0(buf); } /* }}} */ diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c index c94f3eec58..9be2b0658a 100644 --- a/ext/standard/var_unserializer.c +++ b/ext/standard/var_unserializer.c @@ -386,7 +386,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce) (*p) += 2; - if (datalen < 0 || (*p) + datalen >= max) { + if (datalen < 0 || (max - (*p)) <= datalen) { zend_error(E_WARNING, "Insufficient data for unserializing - %pd required, %pd present", datalen, (zend_long)(max - (*p))); return 0; } diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index a11f556f7e..1898c7734c 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -390,7 +390,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce) (*p) += 2; - if (datalen < 0 || (*p) + datalen >= max) { + if (datalen < 0 || (max - (*p)) <= datalen) { zend_error(E_WARNING, "Insufficient data for unserializing - %pd required, %pd present", datalen, (zend_long)(max - (*p))); return 0; } diff --git a/ext/sybase_ct/sybase_ct.dsp b/ext/sybase_ct/sybase_ct.dsp deleted file mode 100644 index ba8f61859c..0000000000 --- a/ext/sybase_ct/sybase_ct.dsp +++ /dev/null @@ -1,114 +0,0 @@ -# Microsoft Developer Studio Project File - Name="sybase_ct" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=sybase_ct - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "sybase_ct.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "sybase_ct.mak" CFG="sybase_ct - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "sybase_ct - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "sybase_ct - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "sybase_ct - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYBASE_CT_EXPORTS" /D "COMPILE_DL_SYBASE_CT" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "SYBASE_CT_EXPORTS" /D "COMPILE_DL_SYBASE_CT" /D HAVE_SYBASE_CT=1 /D ZTS=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib /nologo /dll /machine:I386
-# ADD LINK32 php7ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libct.lib libcs.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_sybase_ct.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF "$(CFG)" == "sybase_ct - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYBASE_CT_EXPORTS" /D "COMPILE_DL_SYBASE_CT" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SYBASE_CT_EXPORTS" /D "COMPILE_DL_SYBASE_CT" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_SYBASE_CT=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts_debug.lib /nologo /dll /machine:I386
-# ADD LINK32 php7ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_sybase_ct.dll" /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "sybase_ct - Win32 Release_TS"
-# Name "sybase_ct - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\php_sybase_ct.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_sybase_ct.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c index 63ccf52370..8ca27d7b9a 100644 --- a/ext/tidy/tidy.c +++ b/ext/tidy/tidy.c @@ -494,7 +494,9 @@ static void TIDY_CALL php_tidy_panic(ctmbstr msg) static int _php_tidy_set_tidy_opt(TidyDoc doc, char *optname, zval *value TSRMLS_DC) { TidyOption opt = tidyGetOptionByName(doc, optname); - zval conv = *value; + zval conv; + + ZVAL_COPY_VALUE(&conv, value); if (!opt) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown Tidy Configuration Option '%s'", optname); diff --git a/ext/tidy/tidy.dsp b/ext/tidy/tidy.dsp deleted file mode 100755 index 57147cb756..0000000000 --- a/ext/tidy/tidy.dsp +++ /dev/null @@ -1,108 +0,0 @@ -# Microsoft Developer Studio Project File - Name="tidy" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=tidy - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "tidy.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "tidy.mak" CFG="tidy - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "tidy - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "tidy - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "tidy - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TIDY_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\include" /I "..\..\..\php_build\include\libtidy" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_TIDY" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "PHP_TIDY_EXPORTS" /D "HAVE_ZLIB" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php7ts.lib libtidy.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_tidy.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\release"
-
-!ELSEIF "$(CFG)" == "tidy - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TIDY_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\..\php_build\include" /I "..\..\..\php_build\include\libtidy" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_TIDY" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "PHP_TIDY_EXPORTS" /D "HAVE_ZLIB" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php7ts_debug.lib libtidy.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_tidy.dll" /pdbtype:sept /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\release"
-
-!ENDIF
-
-# Begin Target
-
-# Name "tidy - Win32 Release_TS"
-# Name "tidy - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\tidy.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_tidy.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/tokenizer/tokenizer.dsp b/ext/tokenizer/tokenizer.dsp deleted file mode 100644 index 25fd5f3dd1..0000000000 --- a/ext/tokenizer/tokenizer.dsp +++ /dev/null @@ -1,108 +0,0 @@ -# Microsoft Developer Studio Project File - Name="tokenizer" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=tokenizer - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "tokenizer.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "tokenizer.mak" CFG="tokenizer - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "tokenizer - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "tokenizer - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "tokenizer - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOKENIZER_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_TOKENIZER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_TOKENIZER=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "NDEBUG"
-# ADD RSC /l 0x407 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php7ts.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_tokenizer.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-
-!ELSEIF "$(CFG)" == "tokenizer - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "TOKENIZER_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "PHP_EXPORTS" /D "COMPILE_DL_TOKENIZER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_TOKENIZER=1 /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x407 /d "_DEBUG"
-# ADD RSC /l 0x407 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php7ts_debug.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_tokenizer.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "tokenizer - Win32 Release_TS"
-# Name "tokenizer - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\tokenizer.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_tokenizer.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/tokenizer/tokenizer_data.c b/ext/tokenizer/tokenizer_data.c index 49dec7c150..209e3ba495 100644 --- a/ext/tokenizer/tokenizer_data.c +++ b/ext/tokenizer/tokenizer_data.c @@ -51,6 +51,7 @@ void tokenizer_register_constants(INIT_FUNC_ARGS) { REGISTER_LONG_CONSTANT("T_MUL_EQUAL", T_MUL_EQUAL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_MINUS_EQUAL", T_MINUS_EQUAL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_PLUS_EQUAL", T_PLUS_EQUAL, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_COALESCE", T_COALESCE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_BOOLEAN_OR", T_BOOLEAN_OR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_BOOLEAN_AND", T_BOOLEAN_AND, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_IS_NOT_IDENTICAL", T_IS_NOT_IDENTICAL, CONST_CS | CONST_PERSISTENT); @@ -74,22 +75,29 @@ void tokenizer_register_constants(INIT_FUNC_ARGS) { REGISTER_LONG_CONSTANT("T_POW", T_POW, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_CLONE", T_CLONE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_NEW", T_NEW, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_EXIT", T_EXIT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_IF", T_IF, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_ELSEIF", T_ELSEIF, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_ELSE", T_ELSE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_ENDIF", T_ENDIF, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_PUBLIC", T_PUBLIC, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_PROTECTED", T_PROTECTED, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_PRIVATE", T_PRIVATE, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_FINAL", T_FINAL, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_ABSTRACT", T_ABSTRACT, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_STATIC", T_STATIC, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_DOUBLE_ARROW", T_DOUBLE_ARROW, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_LNUMBER", T_LNUMBER, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_DNUMBER", T_DNUMBER, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_STRING", T_STRING, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_STRING_VARNAME", T_STRING_VARNAME, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_VARIABLE", T_VARIABLE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_NUM_STRING", T_NUM_STRING, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_INLINE_HTML", T_INLINE_HTML, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_CHARACTER", T_CHARACTER, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_BAD_CHARACTER", T_BAD_CHARACTER, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_ENCAPSED_AND_WHITESPACE", T_ENCAPSED_AND_WHITESPACE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_CONSTANT_ENCAPSED_STRING", T_CONSTANT_ENCAPSED_STRING, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_STRING_VARNAME", T_STRING_VARNAME, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_NUM_STRING", T_NUM_STRING, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_EXIT", T_EXIT, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_IF", T_IF, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_CHARACTER", T_CHARACTER, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_BAD_CHARACTER", T_BAD_CHARACTER, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_ECHO", T_ECHO, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_DO", T_DO, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_WHILE", T_WHILE, CONST_CS | CONST_PERSISTENT); @@ -118,12 +126,6 @@ void tokenizer_register_constants(INIT_FUNC_ARGS) { REGISTER_LONG_CONSTANT("T_USE", T_USE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_INSTEADOF", T_INSTEADOF, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_GLOBAL", T_GLOBAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_PUBLIC", T_PUBLIC, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_PROTECTED", T_PROTECTED, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_PRIVATE", T_PRIVATE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_FINAL", T_FINAL, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_ABSTRACT", T_ABSTRACT, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_STATIC", T_STATIC, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_VAR", T_VAR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_UNSET", T_UNSET, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_ISSET", T_ISSET, CONST_CS | CONST_PERSISTENT); @@ -135,16 +137,16 @@ void tokenizer_register_constants(INIT_FUNC_ARGS) { REGISTER_LONG_CONSTANT("T_EXTENDS", T_EXTENDS, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_IMPLEMENTS", T_IMPLEMENTS, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_OBJECT_OPERATOR", T_OBJECT_OPERATOR, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DOUBLE_ARROW", T_DOUBLE_ARROW, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_LIST", T_LIST, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_ARRAY", T_ARRAY, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_CALLABLE", T_CALLABLE, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_LINE", T_LINE, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_FILE", T_FILE, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("T_DIR", T_DIR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_CLASS_C", T_CLASS_C, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_TRAIT_C", T_TRAIT_C, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_METHOD_C", T_METHOD_C, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_FUNC_C", T_FUNC_C, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_LINE", T_LINE, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_FILE", T_FILE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_COMMENT", T_COMMENT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_DOC_COMMENT", T_DOC_COMMENT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_OPEN_TAG", T_OPEN_TAG, CONST_CS | CONST_PERSISTENT); @@ -158,7 +160,6 @@ void tokenizer_register_constants(INIT_FUNC_ARGS) { REGISTER_LONG_CONSTANT("T_PAAMAYIM_NEKUDOTAYIM", T_PAAMAYIM_NEKUDOTAYIM, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_NAMESPACE", T_NAMESPACE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_NS_C", T_NS_C, CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("T_DIR", T_DIR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_NS_SEPARATOR", T_NS_SEPARATOR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_ELLIPSIS", T_ELLIPSIS, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("T_DOUBLE_COLON", T_PAAMAYIM_NEKUDOTAYIM, CONST_CS | CONST_PERSISTENT); @@ -190,6 +191,7 @@ char *get_token_type_name(int token_type) case T_MUL_EQUAL: return "T_MUL_EQUAL"; case T_MINUS_EQUAL: return "T_MINUS_EQUAL"; case T_PLUS_EQUAL: return "T_PLUS_EQUAL"; + case T_COALESCE: return "T_COALESCE"; case T_BOOLEAN_OR: return "T_BOOLEAN_OR"; case T_BOOLEAN_AND: return "T_BOOLEAN_AND"; case T_IS_NOT_IDENTICAL: return "T_IS_NOT_IDENTICAL"; @@ -213,22 +215,29 @@ char *get_token_type_name(int token_type) case T_POW: return "T_POW"; case T_CLONE: return "T_CLONE"; case T_NEW: return "T_NEW"; - case T_EXIT: return "T_EXIT"; - case T_IF: return "T_IF"; case T_ELSEIF: return "T_ELSEIF"; case T_ELSE: return "T_ELSE"; case T_ENDIF: return "T_ENDIF"; + case T_PUBLIC: return "T_PUBLIC"; + case T_PROTECTED: return "T_PROTECTED"; + case T_PRIVATE: return "T_PRIVATE"; + case T_FINAL: return "T_FINAL"; + case T_ABSTRACT: return "T_ABSTRACT"; + case T_STATIC: return "T_STATIC"; + case T_DOUBLE_ARROW: return "T_DOUBLE_ARROW"; case T_LNUMBER: return "T_LNUMBER"; case T_DNUMBER: return "T_DNUMBER"; case T_STRING: return "T_STRING"; - case T_STRING_VARNAME: return "T_STRING_VARNAME"; case T_VARIABLE: return "T_VARIABLE"; - case T_NUM_STRING: return "T_NUM_STRING"; case T_INLINE_HTML: return "T_INLINE_HTML"; - case T_CHARACTER: return "T_CHARACTER"; - case T_BAD_CHARACTER: return "T_BAD_CHARACTER"; case T_ENCAPSED_AND_WHITESPACE: return "T_ENCAPSED_AND_WHITESPACE"; case T_CONSTANT_ENCAPSED_STRING: return "T_CONSTANT_ENCAPSED_STRING"; + case T_STRING_VARNAME: return "T_STRING_VARNAME"; + case T_NUM_STRING: return "T_NUM_STRING"; + case T_EXIT: return "T_EXIT"; + case T_IF: return "T_IF"; + case T_CHARACTER: return "T_CHARACTER"; + case T_BAD_CHARACTER: return "T_BAD_CHARACTER"; case T_ECHO: return "T_ECHO"; case T_DO: return "T_DO"; case T_WHILE: return "T_WHILE"; @@ -257,12 +266,6 @@ char *get_token_type_name(int token_type) case T_USE: return "T_USE"; case T_INSTEADOF: return "T_INSTEADOF"; case T_GLOBAL: return "T_GLOBAL"; - case T_PUBLIC: return "T_PUBLIC"; - case T_PROTECTED: return "T_PROTECTED"; - case T_PRIVATE: return "T_PRIVATE"; - case T_FINAL: return "T_FINAL"; - case T_ABSTRACT: return "T_ABSTRACT"; - case T_STATIC: return "T_STATIC"; case T_VAR: return "T_VAR"; case T_UNSET: return "T_UNSET"; case T_ISSET: return "T_ISSET"; @@ -274,16 +277,16 @@ char *get_token_type_name(int token_type) case T_EXTENDS: return "T_EXTENDS"; case T_IMPLEMENTS: return "T_IMPLEMENTS"; case T_OBJECT_OPERATOR: return "T_OBJECT_OPERATOR"; - case T_DOUBLE_ARROW: return "T_DOUBLE_ARROW"; case T_LIST: return "T_LIST"; case T_ARRAY: return "T_ARRAY"; case T_CALLABLE: return "T_CALLABLE"; + case T_LINE: return "T_LINE"; + case T_FILE: return "T_FILE"; + case T_DIR: return "T_DIR"; case T_CLASS_C: return "T_CLASS_C"; case T_TRAIT_C: return "T_TRAIT_C"; case T_METHOD_C: return "T_METHOD_C"; case T_FUNC_C: return "T_FUNC_C"; - case T_LINE: return "T_LINE"; - case T_FILE: return "T_FILE"; case T_COMMENT: return "T_COMMENT"; case T_DOC_COMMENT: return "T_DOC_COMMENT"; case T_OPEN_TAG: return "T_OPEN_TAG"; @@ -297,7 +300,6 @@ char *get_token_type_name(int token_type) case T_PAAMAYIM_NEKUDOTAYIM: return "T_DOUBLE_COLON"; case T_NAMESPACE: return "T_NAMESPACE"; case T_NS_C: return "T_NS_C"; - case T_DIR: return "T_DIR"; case T_NS_SEPARATOR: return "T_NS_SEPARATOR"; case T_ELLIPSIS: return "T_ELLIPSIS"; diff --git a/ext/tokenizer/tokenizer_data_gen.sh b/ext/tokenizer/tokenizer_data_gen.sh index a00d341528..0966367020 100755 --- a/ext/tokenizer/tokenizer_data_gen.sh +++ b/ext/tokenizer/tokenizer_data_gen.sh @@ -45,8 +45,8 @@ echo '/* echo 'void tokenizer_register_constants(INIT_FUNC_ARGS) {' >> $OUTFILE -$AWK '/^#define T_/ { print " REGISTER_INT_CONSTANT(\"" $2 "\", " $2 ", CONST_CS | CONST_PERSISTENT);" }' < $INFILE >> $OUTFILE -echo ' REGISTER_INT_CONSTANT("T_DOUBLE_COLON", T_PAAMAYIM_NEKUDOTAYIM, CONST_CS | CONST_PERSISTENT);' >> $OUTFILE +$AWK '/^#define T_/ { print " REGISTER_LONG_CONSTANT(\"" $2 "\", " $2 ", CONST_CS | CONST_PERSISTENT);" }' < $INFILE >> $OUTFILE +echo ' REGISTER_LONG_CONSTANT("T_DOUBLE_COLON", T_PAAMAYIM_NEKUDOTAYIM, CONST_CS | CONST_PERSISTENT);' >> $OUTFILE echo '}' >> $OUTFILE diff --git a/ext/xmlreader/xmlreader.dsp b/ext/xmlreader/xmlreader.dsp deleted file mode 100644 index a2a6c39460..0000000000 --- a/ext/xmlreader/xmlreader.dsp +++ /dev/null @@ -1,114 +0,0 @@ -# Microsoft Developer Studio Project File - Name="xmlreader" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=xmlreader - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "xmlreader.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "xmlreader.mak" CFG="xmlreader - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "xmlreader - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "xmlreader - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "xmlreader - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "xmlreader___Win32_Debug_TS"
-# PROP BASE Intermediate_Dir "xmlreader___Win32_Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLREADER_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLREADER_EXPORTS" /D "COMPILE_DL_XMLREADER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_THREAD_ENABLED" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php7ts_debug.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xmlreader.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release"
-
-!ELSEIF "$(CFG)" == "xmlreader - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "xmlreader___Win32_Release_TS0"
-# PROP BASE Intermediate_Dir "xmlreader___Win32_Release_TS0"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLREADER_EXPORTS" /D "COMPILE_DL_XSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_THREAD_ENABLED" /FR /YX /FD /GZ /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLREADER_EXPORTS" /D "COMPILE_DL_XSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_THREAD_ENABLED" /YX /FD /GZ /c
-# SUBTRACT CPP /Fr
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 php7ts_debug.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xmlreader.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release"
-# ADD LINK32 php7ts.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /incremental:no /machine:I386 /out:"..\..\Release_TS/php_xmlreader.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release"
-# SUBTRACT LINK32 /debug
-
-!ENDIF
-
-# Begin Target
-
-# Name "xmlreader - Win32 Debug_TS"
-# Name "xmlreader - Win32 Release_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\php_xmlreader.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_xmlreader.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/xmlrpc/libxmlrpc/encodings.c b/ext/xmlrpc/libxmlrpc/encodings.c index f4cc212d7c..467dca922e 100644 --- a/ext/xmlrpc/libxmlrpc/encodings.c +++ b/ext/xmlrpc/libxmlrpc/encodings.c @@ -44,6 +44,7 @@ static const char rcsid[] = "#(@) $Id$"; #include <errno.h> +#include <string.h> #ifdef HAVE_GICONV_H #include <giconv.h> diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc.c b/ext/xmlrpc/libxmlrpc/xmlrpc.c index 0f77ae2451..a97b09b303 100644 --- a/ext/xmlrpc/libxmlrpc/xmlrpc.c +++ b/ext/xmlrpc/libxmlrpc/xmlrpc.c @@ -201,9 +201,13 @@ static int date_from_ISO8601 (const char *text, time_t * value) { } p++; } - text = buf; + *p2 = 0; + text = buf; } + if (strlen(text)<17) { + return -1; + } tm.tm_isdst = -1; @@ -219,16 +223,19 @@ static int date_from_ISO8601 (const char *text, time_t * value) { n = 10; tm.tm_mon = 0; for(i = 0; i < 2; i++) { - XMLRPC_IS_NUMBER(text[i]) + XMLRPC_IS_NUMBER(text[i+4]) tm.tm_mon += (text[i+4]-'0')*n; n /= 10; } tm.tm_mon --; + if(tm.tm_mon < 0 || tm.tm_mon > 11) { + return -1; + } n = 10; tm.tm_mday = 0; for(i = 0; i < 2; i++) { - XMLRPC_IS_NUMBER(text[i]) + XMLRPC_IS_NUMBER(text[i+6]) tm.tm_mday += (text[i+6]-'0')*n; n /= 10; } @@ -236,7 +243,7 @@ static int date_from_ISO8601 (const char *text, time_t * value) { n = 10; tm.tm_hour = 0; for(i = 0; i < 2; i++) { - XMLRPC_IS_NUMBER(text[i]) + XMLRPC_IS_NUMBER(text[i+9]) tm.tm_hour += (text[i+9]-'0')*n; n /= 10; } @@ -244,7 +251,7 @@ static int date_from_ISO8601 (const char *text, time_t * value) { n = 10; tm.tm_min = 0; for(i = 0; i < 2; i++) { - XMLRPC_IS_NUMBER(text[i]) + XMLRPC_IS_NUMBER(text[i+12]) tm.tm_min += (text[i+12]-'0')*n; n /= 10; } @@ -252,7 +259,7 @@ static int date_from_ISO8601 (const char *text, time_t * value) { n = 10; tm.tm_sec = 0; for(i = 0; i < 2; i++) { - XMLRPC_IS_NUMBER(text[i]) + XMLRPC_IS_NUMBER(text[i+15]) tm.tm_sec += (text[i+15]-'0')*n; n /= 10; } diff --git a/ext/xmlrpc/tests/bug68027.phpt b/ext/xmlrpc/tests/bug68027.phpt new file mode 100644 index 0000000000..a5c96f1cf2 --- /dev/null +++ b/ext/xmlrpc/tests/bug68027.phpt @@ -0,0 +1,44 @@ +--TEST-- +Bug #68027 (buffer overflow in mkgmtime() function) +--SKIPIF-- +<?php +if (!extension_loaded("xmlrpc")) print "skip"; +?> +--FILE-- +<?php + +$d = '6-01-01 20:00:00'; +xmlrpc_set_type($d, 'datetime'); +var_dump($d); +$datetime = "2001-0-08T21:46:40-0400"; +$obj = xmlrpc_decode("<?xml version=\"1.0\"?><methodResponse><params><param><value><dateTime.iso8601>$datetime</dateTime.iso8601></value></param></params></methodResponse>"); +print_r($obj); + +$datetime = "34770-0-08T21:46:40-0400"; +$obj = xmlrpc_decode("<?xml version=\"1.0\"?><methodResponse><params><param><value><dateTime.iso8601>$datetime</dateTime.iso8601></value></param></params></methodResponse>"); +print_r($obj); + +echo "Done\n"; +?> +--EXPECTF-- +object(stdClass)#1 (3) { + ["scalar"]=> + string(16) "6-01-01 20:00:00" + ["xmlrpc_type"]=> + string(8) "datetime" + ["timestamp"]=> + int(%d) +} +stdClass Object +( + [scalar] => 2001-0-08T21:46:40-0400 + [xmlrpc_type] => datetime + [timestamp] => %s +) +stdClass Object +( + [scalar] => 34770-0-08T21:46:40-0400 + [xmlrpc_type] => datetime + [timestamp] => %d +) +Done diff --git a/ext/xmlrpc/xmlrpc.dsp b/ext/xmlrpc/xmlrpc.dsp deleted file mode 100644 index cc87a169b6..0000000000 --- a/ext/xmlrpc/xmlrpc.dsp +++ /dev/null @@ -1,211 +0,0 @@ -# Microsoft Developer Studio Project File - Name="xmlrpc" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=xmlrpc - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "xmlrpc.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "xmlrpc.mak" CFG="xmlrpc - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "xmlrpc - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "xmlrpc - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "xmlrpc - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLRPC_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "libxmlrpc" /I "..\..\bundle\expat" /D HAVE_XMLRPC=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D ZEND_DEBUG=1 /D ZTS=1 /D COMPILE_DL_XMLRPC=1 /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLRPC_EXPORTS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x1009 /d "_DEBUG"
-# ADD RSC /l 0x1009 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php7ts_debug.lib expat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\Debug_TS/php_xmlrpc.dll" /pdbtype:sept /libpath:"..\..\Debug_TS"
-
-!ELSEIF "$(CFG)" == "xmlrpc - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLRPC_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /I "libxmlrpc" /I "..\..\bundle\expat" /D HAVE_XMLRPC=1 /D "ZEND_WIN32" /D ZEND_DEBUG=0 /D "PHP_WIN32" /D ZTS=1 /D COMPILE_DL_XMLRPC=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLRPC_EXPORTS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x1009 /d "NDEBUG"
-# ADD RSC /l 0x1009 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 php7ts.lib expat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_xmlrpc.dll" /libpath:"..\..\Release_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "xmlrpc - Win32 Debug_TS"
-# Name "xmlrpc - Win32 Release_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=".\xmlrpc-epi-php.c"
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_xmlrpc.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# Begin Group "libxmlrpc"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\libxmlrpc\base64.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\base64.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\encodings.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\encodings.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\queue.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\queue.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\simplestring.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\simplestring.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\system_methods.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\system_methods_private.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xml_element.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xml_element.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xml_to_dandarpc.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xml_to_dandarpc.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xml_to_soap.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xml_to_soap.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xml_to_xmlrpc.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xml_to_xmlrpc.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xmlrpc.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xmlrpc.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xmlrpc_introspection.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xmlrpc_introspection.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xmlrpc_introspection_private.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\libxmlrpc\xmlrpc_private.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/xmlwriter/xmlwriter.dsp b/ext/xmlwriter/xmlwriter.dsp deleted file mode 100644 index e5eca77be5..0000000000 --- a/ext/xmlwriter/xmlwriter.dsp +++ /dev/null @@ -1,113 +0,0 @@ -# Microsoft Developer Studio Project File - Name="xmlwriter" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=xmlwriter - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "xmlwriter.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "xmlwriter.mak" CFG="xmlwriter - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "xmlwriter - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "xmlwriter - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "xmlwriter - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLWRITER_EXPORTS" /D "COMPILE_DL_XMLWRITER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_THREAD_ENABLED" /FR /YX /FD /GZ /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLWRITER_EXPORTS" /D "COMPILE_DL_XMLWRITER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_XMLWRITER=1 /D "LIBXML_STATIC" /YX /FD /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xmlwriter.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release"
-# ADD LINK32 wsock32.lib php4ts.lib libxml2_a.lib iconv.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_xmlwriter.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\bindlib_w32\Release"
-# SUBTRACT LINK32 /debug
-
-!ELSEIF "$(CFG)" == "xmlwriter - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "xmlwriter___Win32_Debug_TS"
-# PROP BASE Intermediate_Dir "xmlwriter___Win32_Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLWRITER_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XMLWRITER_EXPORTS" /D "COMPILE_DL_XMLWRITER" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXML_STATIC" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 wsock32.lib php4ts_debug.lib libxml2_a.lib iconv.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xmlwriter.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release"
-
-!ENDIF
-
-# Begin Target
-
-# Name "xmlwriter - Win32 Release_TS"
-# Name "xmlwriter - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\php_xmlwriter.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_xmlwriter.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/xsl/xsl.dsp b/ext/xsl/xsl.dsp deleted file mode 100644 index 0b8a56d7d2..0000000000 --- a/ext/xsl/xsl.dsp +++ /dev/null @@ -1,120 +0,0 @@ -# Microsoft Developer Studio Project File - Name="xsl" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=xsl - Win32 Debug_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "xsl.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "xsl.mak" CFG="xsl - Win32 Debug_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "xsl - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "xsl - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "xsl - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSL_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_XSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXSLT_STATIC" /D "LIBEXSLT_STATIC" /D "LIBXML_THREAD_ENABLED" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 wsock32.lib php7ts.lib libxslt_a.lib libexslt_a.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_xsl.dll" /implib:".Release_TS/php_xsl.lib" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\bindlib_w32\Release"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF "$(CFG)" == "xsl - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSL_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "XSL_EXPORTS" /D "COMPILE_DL_XSL" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "LIBXSLT_STATIC" /D "LIBEXSLT_STATIC" /D "LIBXML_THREAD_ENABLED" /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 php7ts_debug.lib libxslt_a.lib libexslt_a.lib resolv.lib kernel32.lib user32.lib gdi32.lib winspool.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"..\..\Debug_TS/php_xsl.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\bindlib_w32\Release" /libpath:"..\..\..\php_build\lib\libxslt"
-
-!ENDIF
-
-# Begin Target
-
-# Name "xsl - Win32 Release_TS"
-# Name "xsl - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\php_xsl.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\xsltprocessor.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\php_xsl.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\xsl_fe.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/ext/zlib/zlib.dsp b/ext/zlib/zlib.dsp deleted file mode 100644 index 6a3e98de90..0000000000 --- a/ext/zlib/zlib.dsp +++ /dev/null @@ -1,121 +0,0 @@ -# Microsoft Developer Studio Project File - Name="zlib" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=zlib - Win32 Release_TS -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "zlib.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "zlib.mak" CFG="zlib - Win32 Release_TS" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "zlib - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "zlib - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "zlib - Win32 Release_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_TS" -# PROP BASE Intermediate_Dir "Release_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_TS" -# PROP Intermediate_Dir "Release_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_ZLIB" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZLIB_EXPORTS" /D "COMPILE_DL_ZLIB" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_ZLIB=1 /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts.lib zlib.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_zlib.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\..\php_build\zlib\Release" /libpath:"..\..\Release_TS_Inline" - -!ELSEIF "$(CFG)" == "zlib - Win32 Debug_TS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Debug_TS" -# PROP BASE Intermediate_Dir "Debug_TS" -# PROP BASE Ignore_Export_Lib 0 -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Debug_TS" -# PROP Intermediate_Dir "Debug_TS" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_ZLIB" /D ZTS=1 /YX /FD /c -# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /I "..\..\..\php_build\includes" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZLIB_EXPORTS" /D "COMPILE_DL_ZLIB" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_ZLIB=1 /FR /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x406 /d "NDEBUG" -# ADD RSC /l 0x406 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts_debug.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php7ts_debug.lib zlib.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_zlib.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\zlib\Debug" - -!ENDIF - -# Begin Target - -# Name "zlib - Win32 Release_TS" -# Name "zlib - Win32 Debug_TS" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\zlib.c -# End Source File -# Begin Source File - -SOURCE=.\zlib_fopen_wrapper.c -# End Source File -# Begin Source File - -SOURCE=.\zlib_filter.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\php_zlib.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/ext/zlib/zlib_filter.c b/ext/zlib/zlib_filter.c index 6966c2a9ff..45ef2a8f7d 100644 --- a/ext/zlib/zlib_filter.c +++ b/ext/zlib/zlib_filter.c @@ -76,8 +76,6 @@ static php_stream_filter_status_t php_zlib_inflate_filter( while (buckets_in->head) { size_t bin = 0, desired; - bucket = buckets_in->head; - bucket = php_stream_bucket_make_writeable(buckets_in->head TSRMLS_CC); while (bin < (unsigned int) bucket->buflen) { |
