1
0
mirror of https://github.com/php/php-src.git synced 2026-03-25 16:52:18 +01:00
Commit Graph

6382 Commits

Author SHA1 Message Date
Peter Kokot
16e218a596 Autotools: Obsolete PHP_TEST_BUILD, PHP_BUILD_THREAD_SAFE, and PHP_DEF_HAVE (#15802)
The PHP_BUILD_THREAD_SAFE macro is a simple wrapper around setting the
enable_zts variable and can't be used in PHP extensions realistically.

The PHP_TEST_BUILD macro might produce warnings on certain compiler
configurations and default AC_* macros like AC_LINK_IFELSE,
AC_CHECK_LIB, or AC_CHECK_FUNC are better suited for such checks. Also,
a quick browse through the open-source PHP extensions doesn't find
usages of this macro except in imap extension where patch is was already
sent:
https://github.com/php/pecl-mail-imap/pull/11

PHP_DEF_HAVE is a wrapper around AC_DEFINE and using AC_DEFINE_UNQUOTED
and AS_TR_CPP are better suited for this task where also help text can
be passed. Usages in the open source PHP extensions have been checked and
patches sent where found.
2024-09-08 21:09:48 +02:00
Peter Kokot
b97a60c9a3 Autotools: Check Apache version with apxs and HTTPD_VERSION variable (#15476)
The apxs -q HTTPD_VERSION variable is available since Apache 2.4.17.
This change obsoletes the PHP_AP_EXTRACT_VERSION macro and checks the
version in the config.m4 file directly. Version is checked against the
dotted format instead of the version number.
2024-09-08 20:13:48 +02:00
Peter Kokot
bcbf7bea92 Autotools: Replace uname with host_alias for finding Solaris (#15770)
This wraps checks in AC_CACHE_CHECK and replaces the "uname -sr" command
with simpler $host_alias as it is already set by the config.guess script
properly.
2024-09-06 08:44:10 +02:00
Peter Kokot
13f041163c Remove Travis artefacts (#15714)
Travis was suspended https://github.com/php/php-src/pull/15314

This removes 404 errored Travis image in README, travis configuration
directory and YAML file and usages in tests.

[skip ci]

Co-authored-by: Gina Peter Banyard <girgias@php.net>
2024-09-04 01:15:10 +02:00
Peter Kokot
1a126c540a Autotools: Normalize flags arguments (#15671)
This is a follow up of 7edb9a07d7 that
provides passing compilation options to PHP_NEW_EXTENSION,
PHP_ADD_SOURCES, PHP_ADD_SOURCES_X, and PHP_SELECT_SAPI as a
blank-or-newline-separated argument.
2024-09-01 01:02:40 +02:00
Peter Kokot
e016e3521a Remove redundant HAVE_LIBREADLINE check (#15623)
The HAVE_LIBREADLINE is at this point only defined by Autotools and this
check is for Windows only where only HAVE_LIBEDIT is defined.
2024-08-29 12:49:34 +02:00
Peter Kokot
fbacc0f936 Autotools: Normalize PHP_ADD_BUILD_DIR 1st argument (#15612)
The m4_normalize(m4_expand([$1])) expands the given argument if it
contains M4 macros, and then trims the items together into a space
separated string in an intuitive way.
2024-08-29 00:44:29 +02:00
Orlando Thöny
9c267778d2 FPM: Remove usage of non-existing MAX_LINE_LENGTH constant (#5634) 2024-08-24 15:26:58 +01:00
Flavio Heleno
67aac59cfc Add PHP-FPM memory peak to the scoreboard
Closes #14153
2024-08-24 15:25:18 +01:00
Peter Kokot
b2640ee7f7 Autotools: Replace obsolete backticks with $(...) in apache2handler (#15454)
Obsolete backticks can be replaced with the recommended $(...) (on
shells where the "newer" style still doesn't work, for example, on
Solaris 10 default shell, Autoconf takes care of that by re-executing
the script itself).
2024-08-17 14:37:32 +02:00
Peter Kokot
8db3d36f2f Autotools: Remove redundant SAPI_SHARED assignment (#15453)
When the target system is Darwin, the SAPI_SHARED is already set to
libs/libphp.so (instead of libs/libphp.dylib) in configure.ac and in
php.m4 via PHP_SHLIB_SUFFIX_NAMES.
2024-08-17 10:02:33 +02:00
Peter Kokot
565a31c7c5 Autotools: Simplify PHP_SELECT_SAPI in apache2handler SAPI (#15444) 2024-08-17 00:19:44 +02:00
Peter Kokot
173965331c Autotools: Use AS_* macros in apache2handler SAPI (#15423) 2024-08-16 18:32:13 +02:00
Peter Kokot
24387176d0 Autotools: Sync CS in sapi/cgi (#15407)
- AS_* macros used
- Indentation level synced
- Obsolete backticks replaced with recommended $(...) (on shells where
  the "newer" style still doesn't work, for example on Solaris 10
  default shell, Autoconf takes care of that by re-executing the script
  itself)
2024-08-16 18:30:51 +02:00
Peter Kokot
794ba29a57 Autotools: Fix PHP_EMBED_TYPE variable substitution (#15414)
This is a follow-up of f6dcca00bc as
Autoconf always seems to do a variable substitution, even when called
conditionally. When passing argument other than shared or static to
--enable-embed=ARGUMENT this now puts an empty string inside generated
php-config script.
2024-08-15 11:42:47 +02:00
Peter Kokot
4f4794b12d Autotools: Sync CS in fpm SAPI (#15412)
- AS_* macros used
- obsolete backticks replaced with $(...)
- redundant double quotes removed
2024-08-15 11:39:09 +02:00
Peter Kokot
1e4ed4adaa Autotools: Sync CS in sapi/fuzzer (#15417)
- AS_VAR_IF macro used
- redundant quotes removed
- PHP_FUZZER_TARGET macro body synced with the rest of the macros in
  php-src
- PHP_FUZZER_TARGET arguments quoted
2024-08-15 11:38:34 +02:00
Peter Kokot
f09354e5d0 Autotools: Sync CS in sapi/cli (#15410)
- AS_* macros used
2024-08-14 21:39:19 +02:00
Peter Kokot
bca18bc585 Autotools: Sync CS in sapi/litespeed (#15409)
- AS_CASE macro used
2024-08-14 21:38:36 +02:00
Peter Kokot
53d6ed8a6b Autotools: Fix typo in FPM TCP_CONNECTION_INFO check (#15411)
Otherwise, the check even works with such typo, but this fixes the
TCP_CONNECTION_INFO check on macOS machines for FPM.
2024-08-14 20:05:18 +02:00
Peter Kokot
f6dcca00bc Autotools: Substitute PHP_EMBED_TYPE conditionally (#15396)
If passing wrong argument at --enable-embed=ARGUMENT the AC_SUBST don't
need to be used for it in php-config.
2024-08-14 16:40:10 +02:00
Gina Peter Banyard
a79c70f574 [RFC] Convert exit (and die) from language constructs to functions (#13483)
RFC: https://wiki.php.net/rfc/exit-as-function
2024-08-14 12:44:12 +01:00
Gina Peter Banyard
02177848e4 Replace uses of php_dirname() with zend_dirname() (#15393)
This removes some needs to include the php_string.h header
2024-08-14 12:35:47 +01:00
Peter Kokot
6f44a0d7fe Autotools: Use AS_* macros in embed SAPI (#15387) 2024-08-14 01:17:57 +02:00
Remi Collet
40d88cacc1 Fix test expectation for "Built by..." (#15383) 2024-08-13 21:58:44 +01:00
Peter Kokot
65e96c1e5a Autotools: Fix phpdbg build (#15373)
With 04a67cd86c the list of source files
are now added alphabetically. Previously the phpdbg_parser.c was added
before the phpdbg_lexer.c. Which caused the
"sapi/phpdbg/phpdbg_lexer.l:8:10: fatal error: 'phpdbg_parser.h' file
not found" error.

To make the order of source files irrelevant, the Makefile substitutions
needs to be fixed - the 3rd argument of PHP_ADD_MAKEFILE_FRAGMENT macro,
which is the substitution of the $(builddir) Make variable. The
$(builddir)/phpdbg_lexer.lo was previously substituted to an absolute
path. And the relative should be used, for Make to be able to find the
dependent target.
2024-08-13 10:35:16 +02:00
Peter Kokot
10ed74e3c0 Autotools: Check cli SAPI configure checks conditionally (#15370)
This checks cli SAPI system configuration based on whether the cli is
enabled like with other SAPIs and extensions.
2024-08-13 10:34:28 +02:00
Peter Kokot
540b9f5bc7 Autotools: Wrap long texts with m4_text_wrap (#15368)
The m4_text_wrap macro wraps the text into a single space separated
string which is wrapped to not exceed the line lenght of 79 characters
by default.
2024-08-13 10:33:17 +02:00
Calvin Buckley
afc5738154 Show build provider and unify version information printing (#14657)
* Show build provider information in "php -v"

Vendors such as distributions can set the `PHP_BUILD_PROVIDER`
variable, that gets printed in phpinfo. However, I find that users check
`php -v` more often than phpinfo to see what PHP they're running. The
problem with this is that it does not show that build provider
information.

This change makes the build provider information printed on an
additional line of the version information.

* Put on same line so it works with or without env var

Unbreaks build without PHP_BUILD_PROVIDER set.

* change wording in provider version text

better grammatically; many different possibilities here though

* Unify SAPI version printing

This makes it so that all of the SAPIs share the same code for printing
version information. This is useful in case of any future changes to the
version information, such as i.e. adding build provider to the output.

* Make include for php_print_version explicit

* Preserve phpdbg version and output channel

php_printf doesn't have same semantics, as phpdbg_out could be on a
different output than stdout/err. Also add the phpdbg version (in case
it differs from PHP's, to keep similar output before this PR)

* remove size variables

we don't use them and CI doesn't like unused variables

* Fix format string insecurity
2024-08-12 23:24:41 -03:00
Peter Kokot
9fcc1bca8a Remove redundant middle newlines in "Autotools" related files
This syncs few minor left-overs in "Autotools" related files:
- redundant middle newlines removed (in man pages the duplicate newlines
  are also ignored and are not visible in the man page anyway)
- Minor mixed indentation synced

[skip ci]
2024-08-12 13:18:32 +02:00
Christoph M. Becker
9c537de8a5 Fix some -Wimplicit-function-declaration errors on Windows (GH-15325)
While clang is picky about these, MSVC doesn't seem to care and would
only report the calls to undeclared functions as errors during link
time.  Still, obviously, MSVC is fine with having the declarations
during compile time.
2024-08-10 16:25:28 +02:00
Niels Dossche
c426157823 Merge branch 'PHP-8.3'
* PHP-8.3:
  Add necessary SKIPIFs to new phpdbg tests
2024-08-10 01:11:14 +02:00
Niels Dossche
04adeeaef8 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Add necessary SKIPIFs to new phpdbg tests
2024-08-10 01:11:09 +02:00
Niels Dossche
4d71580e00 Add necessary SKIPIFs to new phpdbg tests
Similarly to other watchpoint tests, we add SKIPIFs.
These TRACKED_ALLOC issues should be investigated though [1] [2].

[1] de5c760c69 (comments)
[2] https://github.com/php/php-src/pull/15229#pullrequestreview-2230563480
2024-08-10 01:10:01 +02:00
Niels Dossche
48bb8fe4c2 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix uninitialized value watchpoint_hit
2024-08-09 23:46:35 +02:00
Niels Dossche
76dae3d0e3 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix uninitialized value watchpoint_hit
2024-08-09 23:46:30 +02:00
Niels Dossche
2e26559fcd Fix uninitialized value watchpoint_hit
Closes GH-15317.
2024-08-09 23:46:16 +02:00
David Carlier
667a5651ca Merge branch 'PHP-8.3' 2024-08-09 21:15:07 +01:00
David Carlier
de5c760c69 Merge branch 'PHP-8.2' into PHP-8.3 2024-08-09 21:12:34 +01:00
David Carlier
9aeb6761b5 Fix GH-15210: phpdbg_print_changed_zvals working on a real copy instead.
Close GH-15229
2024-08-09 21:12:11 +01:00
Peter Kokot
04a67cd86c Autotools: Normalize phpdbg list of source files (#15306) 2024-08-09 10:22:37 +02:00
Niels Dossche
a5c834219b Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15268: heap buffer overflow in phpdbg (zend_hash_num_elements() Zend/zend_hash.h)
2024-08-08 20:35:57 +02:00
Niels Dossche
47e4991d38 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15268: heap buffer overflow in phpdbg (zend_hash_num_elements() Zend/zend_hash.h)
2024-08-08 20:35:50 +02:00
Niels Dossche
a6c547d1dd Fix GH-15268: heap buffer overflow in phpdbg (zend_hash_num_elements() Zend/zend_hash.h)
The class is not yet linked, so we cannot access `parent`, but only
`parent_name`.

Closes GH-15277.
2024-08-08 20:35:20 +02:00
Peter Kokot
dcdcb3cbfe Autotools: Replace AC_MSG_ERROR with AC_MSG_FAILURE (#15209)
This replaces the AC_MSG_ERROR with AC_MSG_FAILURE, where appropriate.

The AC_MSG_ERROR outputs given message and exits the configure step. The
AC_MSG_FAILURE does the same but also automatically outputs additional
message "See 'config.log' for more details." which might help directing
the user where to look further.

The AC_MSG_ERROR is used for errors where current test step isn't logged
in the config.log and wouldn't make sense, and AC_MSG_FAILURE is mostly
used in cases of library checks, compilation tests, headers checked with
AC_CHECK_HEADER* and similar tests that are also logged in the
config.log.

AC_MSG_ERROR([Sanity check failed.]) output:

```
configure: error: Sanity check failed.
```

AC_MSG_FAILURE([Sanity check failed.]) output:

```
configure: error: in '/path/to/php-src':
configure: error: Sanity check failed.
See 'config.log' for more details
```
2024-08-04 07:36:37 +02:00
Peter Kokot
4f07cdc584 Replace PHP_OUTPUT with AC_CONFIG_FILES (#15186)
This is a follow-up of GH-15177
(c96f08aa70)
and GH-15185
(9467ffb43c)

The PHP_OUTPUT macro was introduced in the very early phase of the build
system due to AC_OUTPUT handling issues in the old Autoconf versions
before the AC_CONFIG_FILES, AC_CONFIG_COMMANDS etc were introduced with
the AC_OUTPUT signature without arguments. The PHP_OUTPUT was also
helping Makefile.in back then being properly generated based on whether
all files were generated or only some (when using the obsolete
CONFIG_FILES=... ./config.status invocation instead of the new
./config.status --file=...). Another issue is that PHP_OUTPUT can't be
used by extensions when using phpize.

This replaces the PHP_OUTPUT invocations with default AC_CONFIG_FILES.

The obsolete "REDO_ALL" feature at the config.status invocation is also
removed with a simpler unconditional generation.

In phar extension the "ext/phar" is replaced with $ext_dir variable to
be able to use phpize.
2024-08-03 21:52:14 +02:00
Peter Kokot
16d9bd0aae Sync AC_DEFINE help texts (#15207) 2024-08-03 09:47:39 +02:00
Peter Kokot
0339d8c589 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-13199: Redundant prompt in phpdbg with libedit/readline
2024-08-02 08:38:35 +02:00
Peter Kokot
97049b44bd Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-13199: Redundant prompt in phpdbg with libedit/readline
2024-08-02 08:37:35 +02:00
Peter Kokot
dc670cb7f6 Fix GH-13199: Redundant prompt in phpdbg with libedit/readline
When using libedit/readline integration in phpdbg:

    ./configure --with-libedit --enable-phpdbg-readline

EOF makes editline write prompt again in local console mode. For
example, this can be noticed when reading phpt test files from STDIN and
running phpdbg:

    ./sapi/cli/php run-tests.php sapi/phpdbg

Closes GH-13199
2024-08-02 08:33:57 +02:00