Commit Graph

819 Commits

Author SHA1 Message Date
Nikita Popov
cdefeb715b Use memset instead of brace initialization
Apparently {{0}} is not enough ... let's not rely on structure
layout specifics here.
2019-06-12 13:50:23 +02:00
Nikita Popov
eea206a06c Merge branch 'PHP-7.4' 2019-06-12 13:18:04 +02:00
Nikita Popov
2134cc25d2 Guard functions by SO_PASSCRED 2019-06-12 13:17:25 +02:00
Nikita Popov
477d1e02ae Merge branch 'PHP-7.4' 2019-06-12 11:54:21 +02:00
Nikita Popov
f601eb15e6 Fix -Wmissing-braces warnings
Unfortunate that = {} is a GNU extension.
2019-06-12 11:54:12 +02:00
Joe Watkins
6df77cafb9
Merge branch 'PHP-7.4'
* PHP-7.4:
  fix flaky sockets test - form of response is OS dependent
2019-06-12 08:48:18 +02:00
Joe Watkins
c54a247cb0
fix flaky sockets test - form of response is OS dependent 2019-06-12 08:47:35 +02:00
Joe Watkins
2a11d88bc5
Merge branch 'PHP-7.4'
* PHP-7.4:
  fix flaky test on OSX
2019-06-12 08:33:19 +02:00
Joe Watkins
abe38b5e48
fix flaky test on OSX 2019-06-12 08:33:07 +02:00
Joe Watkins
f5e79e0b40
Merge branch 'PHP-7.4'
* PHP-7.4:
  fix flaky ipv4 loopback test
2019-06-10 10:35:57 +02:00
Joe Watkins
52ca8ca7d5
fix flaky ipv4 loopback test 2019-06-10 10:35:31 +02:00
Christoph M. Becker
3b77f269e9 Merge branch 'PHP-7.4'
* PHP-7.4:
  Use zero port in socket_(export|import)_stream-4-win.phpt
2019-06-06 16:19:37 +02:00
Christoph M. Becker
3b05bdedcd Use zero port in socket_(export|import)_stream-4-win.phpt
These regularly fail due to port clashes, though we don't seem to
use those ports in any other tests.

As we don't care about the specific port that is used here, pass
zero so that a random ephemeral port is used.
2019-06-06 16:19:19 +02:00
Nikita Popov
7686b0b889 Merge branch 'PHP-7.4' 2019-06-05 14:53:50 +02:00
Nikita Popov
a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Nikita Popov
03a9c2df7b Merge branch 'PHP-7.4' 2019-06-05 11:58:20 +02:00
Nikita Popov
528aa7932a Use zero port in socket_(export|import)_stream-5.phpt
These regularly fail due to port clashes, though we don't seem to
use those ports in any other tests.

As we don't care about the specific port that is used here, pass
zero so that a random ephemeral port is used.
2019-06-05 11:58:11 +02:00
Nikita Popov
623eedbbd5 Merge branch 'PHP-7.4' 2019-06-04 16:14:46 +02:00
Nikita Popov
d512075ff8 Fix potential port conflicts 2019-06-04 16:11:52 +02:00
Nikita Popov
1df8175b61 Convert fetch_resource warnings into TypeErrors
More type checks that are not part of zpp and should generate a
TypeError in PHP 8.
2019-06-03 09:17:12 +02:00
Christoph M. Becker
8a11f3b166 Merge branch 'PHP-7.4'
* PHP-7.4:
  Prevent parallel test conflicts
2019-05-27 18:43:18 +02:00
Christoph M. Becker
c12d474653 Prevent parallel test conflicts
These ports are already used by another test, so we change them.
2019-05-27 18:42:52 +02:00
Nikita Popov
22797c0e00 Merge branch 'PHP-7.4' 2019-05-23 11:13:22 +02:00
Nikita Popov
fc8fb77262 Merge branch 'PHP-7.3' into PHP-7.4 2019-05-23 11:13:14 +02:00
Nikita Popov
b394654c1e Merge branch 'PHP-7.2' into PHP-7.3 2019-05-23 11:12:59 +02:00
Nikita Popov
9a74b23297 Fixed bug #78038 socket_select with references 2019-05-23 11:12:15 +02:00
Peter Kokot
2cf90bb2f0 Merge branch 'PHP-7.4'
* PHP-7.4:
  Normalize comments in *nix build system m4 files
2019-05-12 18:51:50 +02:00
Peter Kokot
75fb74860d Normalize comments in *nix build system m4 files
Normalization include:
- Use dnl for everything that can be ommitted when configure is built in
  favor of the shell comment character # which is visible in the output.
- Line length normalized to 80 columns
- Dots for most of the one line sentences
- Macro definitions include similar pattern header comments now
2019-05-12 18:43:03 +02:00
Dmitry Stogov
e188e4170f Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function by reference 2019-04-24 18:28:29 +03:00
Dmitry Stogov
2e4686b566 Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function by reference 2019-04-24 18:16:47 +03:00
Dmitry Stogov
34db07567d Use ZEND_TRA_ASSIGN_REF_... macros for by reference arguments of internal functions. 2019-04-24 16:14:48 +03:00
Nikita Popov
dc42e403a2 Merge branch 'PHP-7.4' 2019-04-15 11:42:55 +02:00
Nikita Popov
7f6c22cb3d Fix last maybe uninit warnings on 7.4
Most of these only occur under GCC 5. Not fond of all the workarounds
(especially the PDO one), but it gets us a clean build...
2019-04-15 11:35:13 +02:00
Peter Kokot
6426420f61 Merge branch 'PHP-7.4'
* PHP-7.4:
  Replace dirname(__FILE__) by __DIR__ in tests
2019-03-15 23:36:47 +01:00
Fabien Villepinte
26dfce7f36 Replace dirname(__FILE__) by __DIR__ in tests 2019-03-15 22:55:30 +01:00
Nikita Popov
852485d8ec Adjust tests for zpp TypeError change 2019-03-11 11:32:20 +01:00
Peter Kokot
9df6a1e4dd Add AS_HELP_STRING to *nix build configure options
The Autoconf's default AS_HELP_STRING macro can properly format help
strings [1] so watching out if columns are aligned manually is not
anymore.

[1] https://www.gnu.org/software/autoconf/manual/autoconf.html#Pretty-Help-Strings
2019-03-07 20:36:59 +01:00
Nikita Popov
c8e10c6119 More zpp error/variation test removals 2019-03-07 15:54:31 +01:00
Nikita Popov
8c62c69265 More zpp error/variation test removals
Some of these tests also check non-zpp conditions -- however, there is
always some other test that also checks those error conditions.
2019-03-06 13:40:22 +01:00
Nikita Popov
c937c55d75 Fix some port collisions in sockets tests 2019-02-25 09:24:45 +01:00
Nikita Popov
db894844e7 Avoid port conflicts in ext/sockets tests 2019-02-19 15:53:24 +01:00
Rodrigo Prado
b86d7738fb Add test socket_setopt() basic functionality
Rodrigo Prado de Jesus royopa@gmail.com
User Group: PHPSP #PHPTestFestBrasil
---------------------------------------------------------------
The function was not coveraged yet
sockets	Function	socket_setopt	no
http://gcov.php.net/viewer.php?version=PHP_HEAD&func=tested_functions
2019-02-13 02:30:48 +01:00
David Carlier
4e87e56e22 Adding bunch of FreeBSD socket options flags specifics.
SO_USER_COOKIE primarly to be traced via dtrace instrumentation.
If SO_USER_COOKIE is available, the rest is so the former is
two years old while the rest is from around 2008.
2019-02-12 10:27:33 +01:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
Nikita Popov
e219ec144e Implement typed properties
RFC: https://wiki.php.net/rfc/typed_properties_v2

This is a squash of PR #3734, which is a squash of PR #3313.

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
Co-authored-by: Joe Watkins <krakjoe@php.net>
Co-authored-by: Dmitry Stogov <dmitry@zend.com>
2019-01-11 15:49:06 +01:00
Anatol Belski
8789348364 Merge branch 'PHP-7.3'
* PHP-7.3:
  Initialize s_un (sockaddr_un) to zero before using it. Fixes #76839.
2018-12-26 19:03:04 +01:00
Anatol Belski
e38e44e3c6 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Initialize s_un (sockaddr_un) to zero before using it. Fixes #76839.
2018-12-26 19:01:36 +01:00
Michael Meyer
3c42c784c2 Initialize s_un (sockaddr_un) to zero before using it. Fixes #76839. 2018-12-26 18:58:27 +01:00
Nikita Popov
ef8fbd6fc9 Merge branch 'PHP-7.3' 2018-11-20 21:16:36 +01:00
Nikita Popov
7a0d3406f6 Merge branch 'PHP-7.2' into PHP-7.3 2018-11-20 21:16:28 +01:00
Mizunashi Mana
e672cd4385 Define __APPLE_USE_RFC_3542 for new ipv6 constants 2018-11-20 21:16:03 +01:00
Joe Watkins
177d45b7e7
Merge branch 'PHP-7.3'
* PHP-7.3:
  Validate length on socket_write
2018-11-13 13:00:50 +01:00
Joe Watkins
8a11c9ee76
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Validate length on socket_write
2018-11-13 13:00:08 +01:00
Joe Watkins
ce4eb89976
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Validate length on socket_write
2018-11-13 12:58:23 +01:00
Thiago Carvalho
ec2e7a2d48
Validate length on socket_write 2018-11-13 12:56:37 +01:00
Mizunashi Mana
8021e0f5dc Suppress already used warning 2018-11-09 11:09:16 +01:00
Peter Kokot
d679f02295 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:33:09 +02:00
Peter Kokot
b746e69887 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:32:30 +02:00
Peter Kokot
f1d7e3ca0b Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:31:31 +02:00
Peter Kokot
113213f027 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:29:24 +02:00
Peter Kokot
d7a3edd45d Trim trailing whitespace in *.phpt 2018-10-14 19:46:15 +02:00
Peter Kokot
782352c54a Trim trailing whitespace in *.phpt 2018-10-14 19:45:12 +02:00
Peter Kokot
17ccbeec32 Trim trailing whitespace in *.phpt 2018-10-14 19:44:14 +02:00
Peter Kokot
7af945e271 Trim trailing whitespace in *.phpt 2018-10-14 19:43:12 +02:00
Gabriel Caruso
9c144e0d82
Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
Peter Kokot
1ad08256f3 Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-14 12:56:38 +02:00
Peter Kokot
1c850bfcca Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-14 12:55:24 +02:00
Peter Kokot
60a69daec6 Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-14 12:54:08 +02:00
Peter Kokot
03f3b8479b Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-14 12:51:01 +02:00
Peter Kokot
902d39a3a7 Trim trailing whitespace in source code files 2018-10-13 14:14:50 +02:00
Peter Kokot
7f6387b59a Trim trailing whitespace in source code files 2018-10-13 14:12:55 +02:00
Peter Kokot
3f72c77ce4 Convert CRLF line endings to LF
This patch simplifies line endings tracked in the Git repository and
syncs them to all include the LF style instead of the CRLF files.

Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)

To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`

Git additionally provides `.gitattributes` file to specify if some files
need to have specific line endings on all platforms (either CRLF or LF).

Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion is core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.

Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.
2018-10-13 11:21:27 +02:00
Anatol Belski
321c0cc349 Fix localized error messages and memory leaks
The FormatMessage API needs to LocalFree the delivered error messages.
In cases where messages are delivered in non ASCII compatible encoding,
the messages might be unreadable. This aligns the error message encoding
with the encoding settings in PHP, the focus is UTF-8 as default.

Initialize error buffer

Avoid code duplication
2018-09-17 10:56:50 +02:00
Peter Kokot
50b9ef8d94 Remove not needed checking for <errno.h>
Header `<errno.h>` is part of the standard C89 headers [1] and on
current systems checking is not need anymore since PHP requires at
least C89. This is noted also by Autoconf itself in the docs and
code [2].

The Autoconf check defined the `HAVE_ERRNO_H` symbol when building PHP
with sockets extension or fpm sapi. This symbol is not utilized across
the PHP source code except in the current version of bundled GD library
which has worked ok so far also with sockets extension or fpm sapi
disabled anyway.

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
2018-09-09 10:19:04 +02:00
Gabriel Caruso
2f7003847d
Make more tests run on Linux 2018-08-28 21:20:00 -03:00
Gabriel Caruso
d570b7382d
Fix SKIPIF conditions for online tests
Add when necessary, as well remove when not
2018-08-05 18:28:28 -03:00
Anatol Belski
9d7c510893 Cleanup unused items 2018-08-02 18:28:56 +02:00
Peter Kokot
4371945b8b Replace obsolete AC_TRY_FOO with AC_FOO_IFELSE
Autoconf 2.50 released in 2001 made several macros obsolete including
the AC_TRY_RUN, AC_TRY_COMPILE and AC_TRY_LINK:
http://git.savannah.gnu.org/cgit/autoconf.git/tree/ChangeLog.2

These macros should be replaced with the current AC_FOO_IFELSE instead:
- AC_TRY_RUN with AC_RUN_IFELSE and AC_LANG_SOURCE
- AC_TRY_LINK with AC_LINK_IFELSE and AC_LANG_PROGRAM
- AC_TRY_COMPILE with AC_COMPILE_IFELSE and AC_LANG_PROGRAM

PHP 5.4 to 7.1 require Autoconf 2.59+ version, PHP 7.2 and above require
2.64+ version, and the PHP 7.2 phpize script requires 2.59+ version which
are all greater than above mentioned 2.50 version therefore systems
should be well supported by now.

This patch was created with the help of autoupdate script:
autoupdate <file>

Reference docs:
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html
- https://www.gnu.org/software/autoconf/manual/autoconf-2.59/autoconf.pdf
2018-07-30 02:36:38 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Dmitry Stogov
169d454593 Use zval_ptr_dtor() imstead of zval_dtor() 2018-07-05 17:55:54 +03:00
Dmitry Stogov
4a475a4976 Replace legacy zval_dtor() by zval_ptr_dtor_nogc() or even more specialized destructors.
zval_dtor() doesn't make a lot of sense in PHP-7.* and it's used incorrectly in some places.
Its occurances should be replaced by zval_ptr_dtor() or zval_ptr_dtor_nogc(), or even more specialized destructors.
2018-07-04 19:22:24 +03:00
Peter Kokot
128cd0d0f2 Remove old SVN keywords substitutions from xsl and sockets tests
When the PHP source code was versioned in Subversion, there was
possible to substitute certain keywords such as $Id$ with revision
number, last change time and author name. Such approach is not used
in Git so this patch removes these outdated artifacts from the xsl
and sockets extensions tests files.
2018-06-13 15:56:06 +02:00
Dmitry Stogov
5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
Anatol Belski
9d4da80e90 Implemented winsock info import/export 2018-05-17 11:36:23 +02:00
Dmitry Stogov
524f5245c5 Avoid useless checks, using zend_string_efree(), in cases where the string is known to be a temporary allocated zend_string. 2018-05-08 17:30:15 +03:00
Thomas Punt
091f69e869 Merge branch 'PHP-7.2'
* PHP-7.2:
  The SO_PASSCRED constant is conditionally defined
2018-04-29 17:38:59 +01:00
Thomas Punt
beab622265 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  The SO_PASSCRED constant is conditionally defined
2018-04-29 17:38:12 +01:00
Thomas Punt
35713efa02 The SO_PASSCRED constant is conditionally defined 2018-04-29 17:34:03 +01:00
Thomas Punt
74ecbbebe5 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix potential memory leaks in sockets extension
2018-04-28 13:58:45 +01:00
Thomas Punt
d990b9316a Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix potential memory leaks in sockets extension
2018-04-28 13:57:30 +01:00
Thomas Punt
643c9c9b47 Fix potential memory leaks in sockets extension 2018-04-28 13:55:24 +01:00
Nikita Popov
ad87e2bd6a Merge branch 'PHP-7.2' 2018-03-23 18:57:58 +01:00
atvoicu
17ed2f21cf Add missing skip prefix for some SKIPIF messages 2018-03-23 18:56:36 +01:00
Nikita Popov
bd2ecb01d2 Merge branch 'PHP-7.2' 2018-03-11 16:37:08 +01:00
Thomas Petazzoni
8489ecefd3 ext/sockets: make AI_IDN usage optional
AI_IDN is not supported by all C libraries (uClibc, musl), so make it
optional, like AI_ALL.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-03-11 16:35:17 +01:00
Anatol Belski
b9040b812c Merge branch 'PHP-7.2'
* PHP-7.2:
  Remove TSRMLS_*
2018-03-01 12:15:20 +01:00
Anatol Belski
3c58b2c31a Remove TSRMLS_* 2018-03-01 12:12:11 +01:00
Gabriel Caruso
ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00
Gabriel Caruso
a5f1a585e6 Removed unused variables 2018-02-11 22:46:33 +01:00
Gabriel Caruso
2d48d734a2 Fix some misspellings 2018-02-06 16:59:00 +01:00
Gabriel Caruso
fef879a2d6 Use bool instead of boolean while throwing a type error
PHP requires boolean typehints to be written "bool" and disallows
"boolean" as an alias. This changes the error messages to match
the actual type name and avoids confusing messages like "must be
of type boolean, boolean given".

This a followup to ce1d69a1f6, which
implements the same change for integer->int.
2018-02-04 23:09:40 +01:00
Gabriel Caruso
ce1d69a1f6 Use int instead of integer in type errors
PHP requires integer typehints to be written "int" and does not
allow "integer" as an alias. This changes type error messages to
match the actual type name and avoids confusing messages like
"must be of the type integer, integer given".
2018-02-04 19:08:23 +01:00
Gabriel Caruso
0709eb80f3 Fix test for TCP_NODELAY constant
Actually check for the constant, instead of just printing a string...
2018-02-04 16:59:29 +01:00
Gabriel Caruso
9a4cc52c23 Remove superfluous PHP version check in tests
Also remove tests that target only old PHP versions.
2018-02-04 16:58:54 +01:00
Gabriel Caruso
53dbc69a8d Use %d when expecting line number in tests 2018-02-02 22:35:13 +01:00
Thomas Punt
e51aadcc4e Merge branch 'PHP-7.2'
* PHP-7.2:
  Use the correct freeing function
2018-01-29 11:17:23 +00:00
Thomas Punt
0f393a6102 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Use the correct freeing function
2018-01-29 11:13:22 +00:00
Thomas Punt
fb128f6512 Use the correct freeing function 2018-01-29 11:13:10 +00:00
Dmitry Stogov
67e47c3ee3 Eliminate useless separations 2018-01-17 12:45:23 +03:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Dmitry Stogov
9e709e2fa0 Move constants into read-only data segment 2017-12-14 18:43:44 +03:00
Dmitry Stogov
6a9d2b2190 Cleanup type conversion 2017-12-07 19:24:55 +03:00
Dmitry Stogov
ccc12b82da Avoid unnecessary reference-counting on strings. 2017-11-16 17:09:32 +03:00
Xinchen Hui
d56a534acc RC manipulation cleanup 2 2017-11-02 12:13:35 +08:00
Sara Golemon
ec90310ea9 Guard against AI_NUMERICSERV not being defined. 2017-10-01 21:37:04 -04:00
Sara Golemon
320c4f22a4
Guard against AI_NUMERICSERV not being defined. 2017-10-01 21:32:31 -04:00
Kalle Sommer Nielsen
c34ba92782 Get rid of all these old package[2].xml files, most of these had no had a release since PHP4, or any release at all in close to 10 years, some even did not have a package registered at pecl
OCI, PDO_OCI and zip are left as they are actively developed and released there
2017-08-17 22:09:29 +02:00
Xinchen Hui
696bd37e67 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed condition check
  Fixed condition check
  another place

Conflicts:
	ext/mcrypt/mcrypt.c
2017-04-10 14:49:13 +08:00
Xinchen Hui
65d77812fc Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed condition check
2017-04-10 14:47:42 +08:00
Xinchen Hui
4bebcb84ad Fixed condition check 2017-04-10 14:47:24 +08:00
David Carlier
93d7cf375e Fix openbsd build: AI_V4MAPPED, AI_ALL not defined 2017-03-27 18:55:34 +02:00
Nikita Popov
b3ca0c2500
zend-test extension to house code that is required for testing internal APIs, but that we would not want to expose for regular builds 2017-03-12 18:58:50 +00:00
Anatol Belski
0e00c56060 Merge branch 'PHP-7.1'
* PHP-7.1:
  templatize the resource number
2017-01-13 15:50:36 +01:00
Anatol Belski
2ae5f2d1a5 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  templatize the resource number
2017-01-13 15:48:33 +01:00
Anatol Belski
3500262b7d templatize the resource number 2017-01-13 15:45:35 +01:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Anatol Belski
afb6ca2566 Finish remaining replacement uint => uint32_t
Tthe core should be normalized now, no uints anymore
2016-12-22 14:32:02 +01:00
Anatol Belski
92175d09c7 fix test portability 2016-11-26 20:27:09 +01:00
Anatol Belski
b204b3abd1 further normalizations, uint vs uint32_t
fix merge mistake

yet one more replacement run
2016-11-26 17:29:01 +01:00
Nikita Popov
5af586bec5 Remove more PHP 6 leftovers from tests 2016-11-24 22:39:39 +01:00
Anatol Belski
bfb9be9bd4 Merge branch 'PHP-7.1'
* PHP-7.1:
  remove TSRMLS_*
2016-11-22 00:33:29 +01:00
Anatol Belski
d61db8d602 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  remove TSRMLS_*
2016-11-22 00:32:42 +01:00
Anatol Belski
5e9b4c26a5 remove TSRMLS_* 2016-11-21 23:53:37 +01:00
Nikita Popov
45f7b2bcc8 Fix CRLF line-endings in tests
Also fix a single instance of CRLF in ibase_query.c.
2016-11-20 22:31:24 +01:00
David Walker
750f3d3f65 Improve getaddrinfo implementation
* Fix some leaks
* Improve some comparisons and casts
* Raise a notice when an unknown hint is provided
2016-09-05 14:27:31 +02:00
David Walker
d59af68fd9 Make sure to copy the right amount of mem over. IPv6 can be larger than struct sockaddr 2016-08-24 11:22:05 -06:00
David Walker
7373ce9149 Fix #72733: Expose getaddrinfo C function, and supporting connect/bind
Feature request was to expose getaddrinfo().  I accomplish this
by having an array of resources that are the addrinfo structures.
The resources can be used in new functions to connect/bind, and
one function to examine the contents of the resource.
2016-08-12 11:29:34 -06:00
Ville Hukkamäki
283b0cc8a5 Fix #72810. Add check for SKIP_ONLINE_TESTS 2016-08-11 12:01:24 +02:00
Christoph M. Becker
81577235ee Merge branch 'PHP-7.0' into PHP-7.1 2016-07-28 17:31:13 +02:00
Christoph M. Becker
573568bbce Merge branch 'PHP-5.6' into PHP-7.0 2016-07-28 17:30:29 +02:00
Christoph M. Becker
c301adbbd1 Fix #72677: SCM_CREDENTIALS related tests should be skipped on AIX
Patch provided by matthieu dot sarter dot external at atos dot net.
2016-07-28 17:19:47 +02:00
Dmitry Stogov
adc95c5114 Fixed compilation warnings 2016-06-23 12:47:06 +03:00
Dmitry Stogov
1616038698 Added ZEND_ATTRIBUTE_FORMAT to some middind functions.
"%p" replaced by ZEND_LONG_FMT to avoid compilation warnings.
Fixed most incorrect use cases of format specifiers.
2016-06-21 16:00:37 +03:00
Chris Wright
e8abb70fc9 Implement socket_export_stream() 2016-05-02 17:08:15 +02:00
Joe Watkins
233115ea23 fix #71609: Segmentation fault on ZTS with gethostbyname 2016-03-31 12:39:01 +01:00
Nikita Popov
1ac152938c Move semicolon into TSRMLS_CACHE_EXTERN/DEFINE
Also re bug #71575.
2016-03-03 16:50:01 +01:00
James Titcumb
c4b188871e Fix bug #71575 removing extra semicolons outside macros 2016-03-03 16:41:03 +01:00
Anatol Belski
71dbad172f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fork test
  fix test
  fork test
  fork test for win32
  fork test
2016-01-18 17:02:23 +01:00
Anatol Belski
fa0dd6006d fork test 2016-01-18 16:59:17 +01:00
Anatol Belski
f0e2fe8e75 fork test for win32 2016-01-18 16:37:04 +01:00
Anatol Belski
f0b02f2351 fork test 2016-01-18 16:34:20 +01:00
Lior Kaplan
ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Julien Pauli
048fb4b00f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed and improved tests
  test to function socket_getopt();
  test to function socket_clear_error();;
  test to function socket_shutdown();
  test to function socket_send();
  test to function gethostname ( void );
  test to function DateTimeZone::getLocation();
  test to function stream_get_transports();
  test to function stream_get_wrappers();
  test to function stream_socket_enable_crypto();
  test to function stream_socket_get_name();
  Create stream_socket_recvfrom.phpt
  test to stream function set_file_buffer.phpt();
  test to function PDO_getAvaliableDrivers;
  test to misc. function connection_status();
  test to function connection_aborted();
  test to function memory_get_peak_usage();
2015-12-24 14:08:59 +01:00
Julien Pauli
d73d9fecf6 Fixed and improved tests 2015-12-24 14:08:44 +01:00
marcosptf
7f31a88bb8 test to function socket_getopt(); 2015-12-24 13:23:00 +01:00
marcosptf
e9d3ff0ec7 test to function socket_shutdown(); 2015-12-24 13:04:38 +01:00
marcosptf
1c0d01522c test to function socket_send(); 2015-12-24 11:48:09 +01:00
Bob Weinand
855bb36fd0 Add support for IPV6_V6ONLY on sockets 2015-11-06 21:45:31 +01:00
Dmitry Stogov
abf3c2f796 Fixed test (it failed on 32-bit Linux and worked on 64-bit Linux just because of luck). 2015-10-07 03:08:11 +03:00
Dmitry Stogov
ad4fa8f758 Fixed incorrect usage of HASH_OF() macro. Replaced HASH_OF() with more appropriate Z_ARRVAL_P() or Z_OBJPROP_P(). 2015-09-24 22:39:59 +03:00
Anatol Belski
4e66cce87c switch to the unified globals accessor where appropriate 2015-07-29 13:26:35 +02:00
Nikita Popov
42e32c33e2 More warning fixes 2015-07-17 21:12:15 +02:00
Dmitry Stogov
4a2e40bb86 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 04:05:24 +03:00
Anatol Belski
7bb52dda6a backport missing rev bfdc9e2805 2015-06-25 11:34:04 +02:00
Kalle Sommer Nielsen
db22946b25 Remove these old references to the DSP files we don't use anymore 2015-06-22 13:29:42 +02:00
Anatol Belski
bfdc9e2805 fix unknown size of void error 2015-06-17 23:43:13 +02:00
Sara Golemon
51a259f378 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix buffer growth in sockets/conversion.c
  Implements extended error messages
2015-06-17 13:34:42 -07:00
Sara Golemon
c4dd65c723 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix buffer growth in sockets/conversion.c
2015-06-17 13:34:33 -07:00
Sara Golemon
d241711f44 Fix buffer growth in sockets/conversion.c
memset() the *end* of the new buffer, not the beginning
Copy the pointer to the buffer, not its initial contents

Fixes bug 69619
2015-06-17 13:34:20 -07:00
Christoph M. Becker
9c8696e645 fixed language dependent Windows socket tests 2015-06-08 08:13:30 +02:00
Dmitry Stogov
4d9a1883aa Fixed bug #68887 (resources are not freed correctly) 2015-04-08 13:29:42 +03:00
Anatol Belski
663074b6b1 cleanup mod version macros and mod defs, round x 2015-03-23 21:30:22 +01:00
Dmitry Stogov
d146d15003 Optimize zend_string_realloc() add more specialized versions zend_string_extend() and zend_string_truncate() 2015-03-20 02:02:42 +03:00
Dmitry Stogov
8633685675 Use specialized macro for string zval creation 2015-03-12 16:53:51 +03:00
Reeze Xia
609f05fc19 ZTS cleanup 2015-03-08 19:25:55 +08:00
Anatol Belski
af3ca74501 made ZEND_TSRMLS_CACHE_* macros look like function calls
which also comply with the current semantics for such macros
2015-02-16 17:19:32 +01:00
Dmitry Stogov
1eb4352143 Use new ZEND_HASH_FOREACH_... API. 2015-02-10 15:43:12 +03:00
Xinchen Hui
e98caf27ea found type is unnecessary 2015-02-02 14:45:19 +08:00
Xinchen Hui
942809909e Cleanup resource handling APIs 2015-02-02 13:23:16 +08:00
Stanislav Malyshev
141b14454c Merge branch 'PHP-5.6'
* PHP-5.6:
  Use better constant since MAXHOSTNAMELEN may mean shorter name
  use right sizeof for memset

Conflicts:
	ext/sockets/sockaddr_conv.c
	ext/standard/dns.c
2015-01-31 21:50:08 -08:00
Stanislav Malyshev
6a960b6d1b Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Use better constant since MAXHOSTNAMELEN may mean shorter name
  use right sizeof for memset
2015-01-31 21:48:40 -08:00
Stanislav Malyshev
af1f867308 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Use better constant since MAXHOSTNAMELEN may mean shorter name
  use right sizeof for memset
2015-01-31 21:48:14 -08:00
Stanislav Malyshev
41bdd6e7cc Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Add mitigation for CVE-2015-0235 (bug #68925)
  Add mitigation for CVE-2015-0235 (bug #68925)
2015-01-31 19:12:20 -08:00
Stanislav Malyshev
882a375dba Add mitigation for CVE-2015-0235 (bug #68925) 2015-01-31 19:10:52 -08:00
Stanislav Malyshev
457367e0b6 Add mitigation for CVE-2015-0235 (bug #68925) 2015-01-31 19:04:55 -08:00
Anatol Belski
6895cf6e69 nmake install missing header 2015-01-30 09:24:18 +01:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Xinchen Hui
73c1be2653 Bump year 2015-01-15 23:26:03 +08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Andrea Faulds
e5eb9530ab Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Anatol Belski
3ca0ca1548 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (102 commits)
  fix dir separator in test
  fix TS build
  fix TS build
  Better fix for bug #68446
  Revert "Merge remote-tracking branch 'origin/PHP-5.6'"
  Revert NEWS and set test to XFAIL
  Revert "Fix bug #68446 (bug with constant defaults and type hints)"
  Improved zend_hash_clean() and added new optimized zend_symtable_clean()
  Use inline version of zval_ptr_dtor()
  Added new optimized zend_array_destroy() function
  Moved i_zval_ptr_dtor() from zend_execute.h to zend_variables.h
  fix REGISTER_NS_*_CONSTANT macros
  Removed useless assert. EG(uninitialized_zval) can't be refcounted.
  Use specialized destructors when types of zvals are known.
  move tests into proper place
  Improved assignment to object property
  Reuse zend_assign_to_variable() in zend_std_write_property()
  cleanup comments from svn/cvs era
  fix dir separator in test
  fork test for windows
  ...
2014-11-26 08:17:35 +01:00
Stanislav Malyshev
529e195778 Merge branch 'pull-request/898'
* pull-request/898:
  add php_create_socket/php_destroy_socket PHP_SOCKETS_API to abel to create socket ressource in other ext
2014-11-23 15:23:01 -08:00