Skip to content

Commit d8d919b

Browse files
committed
Merge branch 'PHP-8.4'
2 parents d208167 + d664f68 commit d8d919b

File tree

108 files changed

+588
-380
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+588
-380
lines changed

bin/check-cmake.php

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ function ($current, $key, $iterator) {
283283
/**
284284
* Check given CMake files for include() issues.
285285
*/
286-
function checkCMakeFiles(Iterator $files, array $modules): int
286+
function checkCMakeInclude(Iterator $files, array $modules): int
287287
{
288288
$status = 0;
289289

@@ -337,6 +337,35 @@ function checkCMakeFiles(Iterator $files, array $modules): int
337337
return $status;
338338
};
339339

340+
/**
341+
* Check for set(<variable>) usages with only one argument. These should be
342+
* replaced with set(<variable> "").
343+
*/
344+
function checkCMakeSet(Iterator $files): int
345+
{
346+
$status = 0;
347+
348+
foreach ($files as $file) {
349+
$content = getCMakeCode($file);
350+
351+
preg_match_all(
352+
'/^[ \t]*set[ \t]*\([ \t\n]*([^ \t\)]+)[ \t]*\)/m',
353+
$content,
354+
$matches,
355+
PREG_SET_ORDER,
356+
);
357+
358+
foreach ($matches as $match) {
359+
$argument = (array_key_exists(1, $match)) ? trim($match[1]) : '';
360+
361+
$status = 1;
362+
output("E: Replace set($argument) with set($argument \"\") in \n $file \n");
363+
}
364+
}
365+
366+
return $status;
367+
};
368+
340369
/**
341370
* Find all local Find* modules in the project.
342371
*/
@@ -717,7 +746,10 @@ function checkAll(array $options): int
717746
$allCMakeFiles = getAllCMakeFiles($options['path'] . '/cmake');
718747

719748
$projectModules = getProjectModules();
720-
$status = checkCMakeFiles($allCMakeFiles, $projectModules);
749+
$status = checkCMakeInclude($allCMakeFiles, $projectModules);
750+
751+
$newStatus = checkCMakeSet($allCMakeFiles);
752+
$status = (0 === $status) ? $newStatus : $status;
721753

722754
$findModules = getFindModules($options['path'] . '/cmake/cmake/modules');
723755
$newStatus = checkFindModules($findModules, $allCMakeFiles);

bin/init.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ endif()
123123

124124
file(GLOB_RECURSE patches ${PHP_ROOT_DIR}/patches/${PHP_VERSION}/*.patch)
125125

126-
foreach(patch ${patches})
126+
foreach(patch IN LISTS patches)
127127
# Apply the patch with Git.
128128
execute_process(
129129
COMMAND ${GIT_EXECUTABLE} apply --ignore-whitespace "${patch}"

bin/php.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ function(php_download)
235235

236236
# Download PHP tarball.
237237
if(NOT EXISTS ${PHP_TARBALL})
238-
foreach(url ${urls})
238+
foreach(url IN LISTS urls)
239239
php_check_url(${url} found)
240240

241241
if(found)
@@ -299,7 +299,7 @@ function(php_prepare_sources)
299299
string(REGEX MATCH [[^([0-9]+\.[0-9]+)]] _ "${PHP_VERSION}")
300300
file(GLOB_RECURSE patches ${PHP_ROOT_DIR}/patches/${CMAKE_MATCH_1}/*.patch)
301301

302-
foreach(patch ${patches})
302+
foreach(patch IN LISTS patches)
303303
# Execute the patch command.
304304
execute_process(
305305
COMMAND ${GIT_EXECUTABLE} apply --ignore-whitespace "${patch}"

cmake/CMakeLists.txt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ cmake_minimum_required(VERSION 3.25...3.31)
33
# Configure CMake behavior.
44
include(cmake/CMakeDefaults.cmake)
55

6-
message(STATUS "-----------------------------")
76
message(STATUS "Initializing PHP build system")
8-
message(STATUS "-----------------------------\n")
7+
message(STATUS "=============================")
98

109
message(STATUS "CMake version: ${CMAKE_VERSION}")
1110
message(STATUS "CMake generator: ${CMAKE_GENERATOR}")
@@ -31,31 +30,33 @@ add_subdirectory(sapi)
3130
add_subdirectory(ext)
3231
add_subdirectory(Zend)
3332

34-
message(STATUS "---------------")
33+
message(STATUS "")
34+
message(STATUS "")
3535
message(STATUS "Configuring PHP")
36-
message(STATUS "---------------\n")
36+
message(STATUS "===============")
37+
message(STATUS "")
3738

3839
add_subdirectory(pear)
3940
add_subdirectory(win32)
4041
add_subdirectory(main)
4142
add_subdirectory(scripts)
4243

43-
# Check thread safety.
44-
include(PHP/ThreadSafety)
45-
4644
# Generate *_arginfo.h headers from *.stub.php sources.
4745
include(PHP/Stubs)
4846

47+
# Check thread safety.
48+
include(PHP/ThreadSafety)
49+
4950
# Execute all deferred calls. Calls are additionally sorted with natural
5051
# comparison method by their IDs. If call hasn't set any ID number, CMake
5152
# assigns it a default value of __<number>.
5253
block()
5354
cmake_language(DEFER GET_CALL_IDS ids)
5455
list(SORT ids COMPARE NATURAL)
55-
foreach(id ${ids})
56+
foreach(id IN LISTS ids)
5657
cmake_language(DEFER GET_CALL ${id} call)
5758
list(POP_FRONT call command)
58-
message(STATUS "Executing deferred call: ${command}")
59+
message(VERBOSE "Executing deferred call: ${command}")
5960
cmake_language(CALL ${command} ${call})
6061
cmake_language(DEFER CANCEL_CALL ${id})
6162
endforeach()
@@ -73,6 +74,7 @@ include(cmake/Testing.cmake)
7374
include(cmake/CPack.cmake)
7475

7576
include(PHP/FeatureSummary)
77+
php_feature_summary()
7678

7779
message(
7880
STATUS

cmake/Zend/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ CMake target properties for the `Zend::Zend` target:
3030
compatible with particular PHP build.
3131
#]=============================================================================]
3232

33-
message(STATUS "-----------------------")
33+
message(STATUS "")
34+
message(STATUS "")
3435
message(STATUS "Configuring Zend Engine")
35-
message(STATUS "-----------------------\n")
36+
message(STATUS "=======================")
37+
message(STATUS "")
3638

3739
include(cmake/Version.cmake)
3840

@@ -526,7 +528,7 @@ endif()
526528
add_feature_info(
527529
"Zend signals"
528530
ZEND_SIGNALS
529-
"signals handling within the Zend Engine for performance"
531+
"signal handling for performance"
530532
)
531533

532534
################################################################################

cmake/cmake/Bootstrap.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ include(cmake/Configuration.cmake)
5353
# Check requirements.
5454
include(cmake/Requirements.cmake)
5555

56-
message(STATUS "---------------------")
56+
message(STATUS "")
57+
message(STATUS "")
5758
message(STATUS "Running system checks")
58-
message(STATUS "---------------------\n")
59+
message(STATUS "=====================")
60+
message(STATUS "")
5961

6062
# Run PHP configuration checks.
6163
include(cmake/ConfigureChecks.cmake)

cmake/cmake/ConfigureChecks.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,5 +814,5 @@ endif()
814814
add_feature_info(
815815
"Valgrind"
816816
PHP_VALGRIND
817-
"support for dynamic analysis"
817+
"dynamic analysis"
818818
)

cmake/cmake/Testing.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ block()
1717
endif()
1818

1919
get_property(extensions GLOBAL PROPERTY PHP_EXTENSIONS)
20-
foreach(extension ${extensions})
20+
foreach(extension IN LISTS extensions)
2121
get_target_property(type php_${extension} TYPE)
2222
if(type MATCHES "^(MODULE|SHARED)_LIBRARY$")
2323
get_target_property(isZendExtension php_${extension} PHP_ZEND_EXTENSION)

cmake/cmake/modules/FindACL.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ if(NOT DEFINED ACL_IS_BUILT_IN)
134134
endblock()
135135
endif()
136136

137-
set(_ACL_REQUIRED_VARS)
137+
set(_ACL_REQUIRED_VARS "")
138138
if(ACL_IS_BUILT_IN)
139139
set(_ACL_REQUIRED_VARS _ACL_IS_BUILT_IN_MSG)
140140
set(_ACL_IS_BUILT_IN_MSG "built in to C library")

cmake/cmake/modules/FindCapstone.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ block(PROPAGATE Capstone_VERSION)
7070
"^#[ \t]*define[ \t]+CS_(API_MAJOR|API_MINOR|VERSION_EXTRA)[ \t]+[0-9]+[ \t]*$"
7171
)
7272

73-
set(Capstone_VERSION)
73+
set(Capstone_VERSION "")
7474

7575
foreach(item CS_API_MAJOR CS_API_MINOR CS_VERSION_EXTRA)
7676
foreach(line ${results})

0 commit comments

Comments
 (0)