Skip to content

Commit 95262bc

Browse files
committed
Merge branch 'PHP-8.4'
2 parents 380c533 + bf4c46b commit 95262bc

File tree

3 files changed

+41
-17
lines changed

3 files changed

+41
-17
lines changed

cmake/ext/mysqlnd/CMakeLists.txt

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,10 @@ add_feature_info(
3333

3434
cmake_dependent_option(
3535
EXT_MYSQLND_SSL
36-
"Explicitly enable extended SSL support in the mysqlnd extension when\
37-
building without openssl extension (EXT_OPENSSL=OFF) or when using phpize. If\
38-
the openssl extension is enabled at the configure step (EXT_OPENSSL=ON),\
39-
extended SSL is enabled implicitly regardless of this option."
36+
"Explicitly enable extended SSL support in the mysqlnd extension through a\
37+
system library OpenSSL (*nix) or Crypt32 (Windows)."
4038
OFF
41-
"EXT_MYSQLND;NOT EXT_OPENSSL"
39+
[[EXT_MYSQLND AND NOT EXT_OPENSSL AND NOT CMAKE_SYSTEM_NAME STREQUAL "Windows"]]
4240
OFF
4341
)
4442

@@ -118,20 +116,29 @@ set(MYSQLND_SSL_SUPPORTED 1 CACHE INTERNAL "Enable core mysqlnd SSL code")
118116
# A deferred configuration, so it is executed after the openssl extension to
119117
# have the EXT_OPENSSL variable available.
120118
function(php_mysqlnd_post_configuration)
121-
if(EXT_MYSQLND_SSL OR EXT_OPENSSL)
122-
find_package(OpenSSL ${PHP_OPENSSL_MIN_VERSION})
123-
set_package_properties(
124-
OpenSSL
125-
PROPERTIES
126-
TYPE REQUIRED
127-
PURPOSE "Necessary to enable SSL in the mysqlnd extension."
119+
if(
120+
(
121+
NOT CMAKE_SYSTEM_NAME STREQUAL "Windows"
122+
AND (EXT_MYSQLND_SSL OR EXT_OPENSSL)
128123
)
129-
130-
target_link_libraries(php_mysqlnd PRIVATE OpenSSL::Crypto)
124+
OR CMAKE_SYSTEM_NAME STREQUAL "Windows"
125+
)
126+
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
127+
target_link_libraries(php_mysqlnd PRIVATE crypt32)
128+
else()
129+
find_package(OpenSSL ${PHP_OPENSSL_MIN_VERSION})
130+
set_package_properties(
131+
OpenSSL
132+
PROPERTIES
133+
TYPE REQUIRED
134+
PURPOSE "Necessary to enable SSL in the mysqlnd extension."
135+
)
136+
target_link_libraries(php_mysqlnd PRIVATE OpenSSL::Crypto)
137+
endif()
131138

132139
set(
133140
MYSQLND_HAVE_SSL 1
134-
CACHE INTERNAL "Enable mysqlnd extended SSL that uses OpenSSL directly"
141+
CACHE INTERNAL "Enable mysqlnd extended SSL"
135142
)
136143

137144
add_dependencies(php_mysqlnd php_hash)
@@ -140,7 +147,7 @@ function(php_mysqlnd_post_configuration)
140147
add_feature_info(
141148
"ext/mysqlnd SSL"
142149
MYSQLND_HAVE_SSL
143-
"Extended SSL support through OpenSSL"
150+
"Extended SSL support through a system library"
144151
)
145152
endfunction()
146153

cmake/main/php_config.cmake.h.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1783,7 +1783,8 @@
17831783
/* Define to 1 if mysqlnd has compressed protocol support. */
17841784
#cmakedefine MYSQLND_COMPRESSION_ENABLED 1
17851785

1786-
/* Define to 1 if mysqlnd extended SSL is enabled through OpenSSL. */
1786+
/* Define to 1 if mysqlnd has extended SSL enabled through a system library
1787+
OpenSSL (*nix systems), or Crypt32 (Windows systems). */
17871788
#cmakedefine MYSQLND_HAVE_SSL 1
17881789

17891790
/* Define to 1 if mysqlnd core SSL is enabled. */

docs/configuration.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,22 @@ documentation.
219219

220220
## 6. PHP extensions configuration
221221

222+
* `EXT_MYSQLND_SSL=OFF|ON`
223+
224+
Default: `OFF`
225+
226+
Explicitly enable extended SSL support in the `mysqlnd` extension. On \*nix
227+
systems, extended SSL works through the OpenSSL library and on Windows through
228+
the Windows Crypt32 library. Beneficial when building without the `openssl`
229+
extension or when building with phpize.
230+
231+
\*nix systems: when building with the `openssl` extension (`EXT_OPENSSL=ON`)
232+
in the php-src tree, the extended SSL is enabled implicitly regardless of this
233+
option.
234+
235+
Windows systems: extended SSL is enabled implicitly based on the Crypt32
236+
library regardless of this option.
237+
222238
* `EXT_ODBC=OFF|ON`
223239

224240
Default: `OFF`

0 commit comments

Comments
 (0)