Skip to content

Commit 1eef622

Browse files
committed
Sync with upstream
- ext/intl new source files - new configuration option PHP_SYSTEM_GLOB - headers and source files synced - changelogs updated - added checks for issetugid() and reallocarray().
1 parent c105acc commit 1eef622

File tree

11 files changed

+59
-5
lines changed

11 files changed

+59
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ repository.
66
## PHP 8.5
77

88
* C11 standard
9-
* ...
9+
10+
New configuration variables:
11+
12+
* PHP_SYSTEM_GLOB
1013

1114
## PHP 8.4
1215

cmake/Zend/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ target_sources(
265265
zend_ptr_stack.h
266266
zend_range_check.h
267267
zend_signal.h
268+
zend_simd.h
268269
zend_smart_str_public.h
269270
zend_smart_str.h
270271
zend_smart_string_public.h

cmake/cmake/Configuration.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,15 @@ mark_as_advanced(PHP_LIBGCC)
160160
option(PHP_CCACHE "Use ccache if available on the system" ON)
161161
mark_as_advanced(PHP_CCACHE)
162162

163+
cmake_dependent_option(
164+
PHP_SYSTEM_GLOB
165+
"Use the system glob() function instead of the PHP provided replacement"
166+
OFF
167+
[[NOT CMAKE_SYSTEM_NAME STREQUAL "Windows"]]
168+
OFF
169+
)
170+
mark_as_advanced(PHP_SYSTEM_GLOB)
171+
163172
################################################################################
164173
# Set PHP_EXTENSION_DIR.
165174
################################################################################

cmake/cmake/ConfigureChecks.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ check_symbol_exists(getgrnam_r "grp.h" HAVE_GETGRNAM_R)
303303
check_symbol_exists(getpwuid_r "pwd.h" HAVE_GETPWUID_R)
304304
check_symbol_exists(getwd "unistd.h" HAVE_GETWD)
305305
check_symbol_exists(glob "glob.h" HAVE_GLOB)
306+
check_symbol_exists(issetugid "unistd.h" HAVE_ISSETUGID)
306307
check_symbol_exists(lchown "unistd.h" HAVE_LCHOWN)
307308
check_symbol_exists(memcntl "sys/mman.h" HAVE_MEMCNTL)
308309

@@ -324,6 +325,7 @@ check_symbol_exists(
324325
HAVE_PTHREAD_JIT_WRITE_PROTECT_NP
325326
)
326327
check_symbol_exists(putenv "stdlib.h" HAVE_PUTENV)
328+
check_symbol_exists(reallocarray "stdlib.h" HAVE_REALLOCARRAY)
327329
check_symbol_exists(scandir "dirent.h" HAVE_SCANDIR)
328330
check_symbol_exists(setitimer "sys/time.h" HAVE_SETITIMER)
329331
check_symbol_exists(setenv "stdlib.h" HAVE_SETENV)

cmake/ext/intl/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ target_sources(
118118
intl_convert.c
119119
intl_convertcpp.cpp
120120
intl_error.c
121+
listformatter/listformatter_class.c
122+
listformatter/listformatter.stub.php
121123
locale/locale_class.c
122124
locale/locale_methods.c
123125
locale/locale.c

cmake/main/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ target_sources(
2727
network.c
2828
output.c
2929
php_content_types.c
30+
php_glob.c
3031
php_ini_builder.c
3132
php_ini.c
3233
php_odbc_utils.c
@@ -57,13 +58,15 @@ target_sources(
5758
PUBLIC
5859
FILE_SET HEADERS
5960
FILES
61+
charclass.h
6062
fastcgi.h
6163
fopen_wrappers.h
6264
http_status_codes.h
6365
main_arginfo.h
6466
php_compat.h
6567
php_content_types.h
6668
php_getopt.h
69+
php_glob.h
6770
php_globals.h
6871
php_ini_builder.h
6972
php_ini.h

cmake/main/cmake/php_config.h.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@
222222
/* Define to 1 if IPv6 is enabled and supported. */
223223
#cmakedefine HAVE_IPV6 1
224224

225+
/* Define to 1 if you have the 'issetugid' function. */
226+
#cmakedefine HAVE_ISSETUGID 1
227+
225228
/* Define to 1 if you have the <langinfo.h> header file. */
226229
#cmakedefine HAVE_LANGINFO_H 1
227230

@@ -300,6 +303,9 @@
300303
/* Define to 1 if you have the <pwd.h> header file. */
301304
#cmakedefine HAVE_PWD_H 1
302305

306+
/* Define to 1 if you have the 'reallocarray' function. */
307+
#cmakedefine HAVE_REALLOCARRAY 1
308+
303309
/* Define to 1 if you have the <resolv.h> header file. */
304310
#cmakedefine HAVE_RESOLV_H 1
305311

@@ -597,6 +603,10 @@
597603
/* Define to 1 if PHP uses its own SIGCHLD handler, and to 0 if not. */
598604
#cmakedefine01 PHP_SIGCHILD
599605

606+
/* Define to 1 if PHP uses the system glob() function instead of
607+
php_glob(). */
608+
#cmakedefine PHP_SYSTEM_GLOB 1
609+
600610
/* The 'uname -a' output. */
601611
#cmakedefine PHP_UNAME "@PHP_UNAME@"
602612

cmake/win32/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ target_sources(
2121
fnmatch.c
2222
ftok.c
2323
getrusage.c
24-
glob.c
2524
globals.c
2625
ioutil.c
2726
nice.c
@@ -37,12 +36,10 @@ target_sources(
3736
PUBLIC
3837
FILE_SET HEADERS
3938
FILES
40-
charclass.h
4139
codepage.h
4240
console.h
4341
fnmatch.h
4442
getrusage.h
45-
glob.h
4643
ioutil.h
4744
ipc.h
4845
nice.h

docs/cmake/configuration.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ documentation.
192192
* [`PHP_LIBGCC`](/docs/cmake/variables/PHP_LIBGCC.md)
193193
* [`PHP_RE2C_COMPUTED_GOTOS`](/docs/cmake/variables/PHP_RE2C_COMPUTED_GOTOS.md)
194194
* [`PHP_SIGCHILD`](/docs/cmake/variables/PHP_SIGCHILD.md)
195+
* [`PHP_SYSTEM_GLOB`](/docs/cmake/variables/PHP_SYSTEM_GLOB.md)
195196
* [`PHP_THREAD_SAFETY`](/docs/cmake/variables/PHP_THREAD_SAFETY.md)
196197
* [`PHP_UNDEFINED_SANITIZER`](/docs/variables/_PHP_UNDEFINED_SANITIZER.md)
197198
* [`PHP_USE_RTLD_NOW`](/docs/cmake/variables/PHP_USE_RTLD_NOW.md)
@@ -669,6 +670,18 @@ A list of Autoconf `configure` command-line configuration options, Windows
669670
<td>PHP_LIBGCC=ON</td>
670671
<td></td>
671672
</tr>
673+
<tr>
674+
<td>--disable-system-glob</td>
675+
<td>N/A</td>
676+
<td>PHP_SYSTEM_GLOB=OFF</td>
677+
<td>default, PHP &gt;= 8.5</td>
678+
</tr>
679+
<tr>
680+
<td>&emsp;--enable-system-glob</td>
681+
<td>N/A</td>
682+
<td>PHP_SYSTEM_GLOB=ON</td>
683+
<td>PHP &gt;= 8.5</td>
684+
</tr>
672685
<tr>
673686
<td>--enable-all</td>
674687
<td>--enable-snapshot-build</td>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# `PHP_SYSTEM_GLOB`
2+
3+
:green_circle: *New in PHP 8.5.*
4+
5+
* Default: `OFF`
6+
* Values: `ON|OFF`
7+
8+
When enabled, system `glob()` function will be used for PHP glob functionality
9+
instead of the PHP `php_glob()` built-in implementation.
10+
11+
> [!NOTE]
12+
> This option is not available when the target system is Windows.

0 commit comments

Comments
 (0)