Skip to content

Commit 159f1b5

Browse files
alcaeuscmb69
andauthored
PHPC-1704: Check for standard and date extensions on Windows builds (#1178)
* PHPC-1704: Check for standard and date extensions on Windows builds In PHP 8, PHP 7.3.25+, and PHP 7.4.13+, ADD_EXTENSION_DEP can correctly check for the date and standard extensions. On older versions, we have to continue to assume that these extensions are in fact installed. * Be more "adventurous" with version checks Co-authored-by: Christoph M. Becker <[email protected]> Co-authored-by: Christoph M. Becker <[email protected]>
1 parent 05ce4fb commit 159f1b5

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

config.w32

+12-3
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,18 @@ ARG_WITH("mongodb-sasl", "MongoDB: Build against Cyrus-SASL", "yes");
6565
ARG_WITH("mongodb-client-side-encryption", "MongoDB: Enable client-side encryption", "yes");
6666

6767
if (PHP_MONGODB != "no") {
68-
/* Note: ADD_EXTENSION_DEP() cannot be used to declare that we depend on the
69-
* date and standard extensions. Assume that they're always enabled. */
68+
/* Note: ADD_EXTENSION_DEP() only reports the date and standard extensions as
69+
* installed in PHP 7.3.25+, 7.4.13+, and 8.0.0+). On other versions, assume
70+
* that they're always enabled. */
71+
if (
72+
PHP_VERSION >= 8 ||
73+
(PHP_VERSION == 7 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION >= 25) ||
74+
(PHP_VERSION == 7 && PHP_MINOR_VERSION == 4 && PHP_RELEASE_VERSION >= 13)
75+
) {
76+
ADD_EXTENSION_DEP("mongodb", "date", false);
77+
ADD_EXTENSION_DEP("mongodb", "standard", false);
78+
}
79+
7080
ADD_EXTENSION_DEP("mongodb", "json", false);
7181
ADD_EXTENSION_DEP("mongodb", "spl", false);
7282

@@ -365,4 +375,3 @@ if (PHP_MONGODB != "no") {
365375
mongodb_parse_version_file(configure_module_dirname + "/src/LIBMONGOC_VERSION_CURRENT", "MONGOC_")
366376
);
367377
}
368-

0 commit comments

Comments
 (0)