Skip to content

Commit fe99deb

Browse files
authored
PHPC-1880: Drop support for PHP 7.1 (#1273)
* PHPC-1880: Drop support for PHP 7.1 * Bump PHP versions in AppVeyor config * PHPC-1880: Update Evergreen config for PHP 7.2+ and MongoDB 5.0 Bump edge-versions:latest-stable to MongoDB 5.0. Drops PHP 7.1 and adds PHP 8.0 to php-versions and newly created php-edge-versions axis. Use oldest-supported or latest-stable PHP version for matrices other than test-php-versions. Make variant display names consistent to help detect duplicates. Remove WiredTiger from mongo-42-storage-engines since it's tested in most other variants by default. * Revise "cursor not found" error message assertions for latest server version * Temporarily remove 1.19.x from libmongoc-version axis
1 parent a8a2210 commit fe99deb

File tree

10 files changed

+113
-109
lines changed

10 files changed

+113
-109
lines changed

.appveyor.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,30 @@ environment:
1515
CONFIGURE_OPTS: --enable-mongodb --with-mongodb-sasl=yes --with-mongodb-client-side-encryption=yes
1616

1717
matrix:
18-
- PHP_VER: 8.0.7
18+
- PHP_VER: 8.0.12
1919
TS: 1
2020
CRT: vs16
2121
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
22-
- PHP_VER: 8.0.7
22+
- PHP_VER: 8.0.12
2323
TS: 0
2424
CRT: vs16
2525
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
26-
- PHP_VER: 7.4.20
26+
- PHP_VER: 7.4.25
2727
TS: 1
2828
CRT: vc15
29-
- PHP_VER: 7.4.20
29+
- PHP_VER: 7.4.25
3030
TS: 0
3131
CRT: vc15
32-
- PHP_VER: 7.3.28
32+
- PHP_VER: 7.3.32
3333
TS: 1
3434
CRT: vc15
35-
- PHP_VER: 7.3.28
35+
- PHP_VER: 7.3.32
3636
TS: 0
3737
CRT: vc15
38-
- PHP_VER: 7.2.29
38+
- PHP_VER: 7.2.34
3939
TS: 1
4040
CRT: vc15
41-
- PHP_VER: 7.2.29
41+
- PHP_VER: 7.2.34
4242
TS: 0
4343
CRT: vc15
4444

.evergreen/config.yml

Lines changed: 99 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,9 +1071,8 @@ axes:
10711071
- id: edge-versions
10721072
display_name: MongoDB Version
10731073
values:
1074-
# TODO: Exclude rhel74-zseries and rhel71-power8 in tests-php7 once latest-stable is bumped from 4.4 to 5.0
10751074
- id: "latest-stable"
1076-
display_name: "MongoDB 4.4"
1075+
display_name: "MongoDB 5.0"
10771076
variables:
10781077
VERSION: "4.4"
10791078
- id: "oldest-supported"
@@ -1084,6 +1083,10 @@ axes:
10841083
- id: php-versions
10851084
display_name: PHP Version
10861085
values:
1086+
- id: "8.0"
1087+
display_name: "PHP 8.0"
1088+
variables:
1089+
PHP_VERSION: "8.0"
10871090
- id: "7.4"
10881091
display_name: "PHP 7.4"
10891092
variables:
@@ -1096,12 +1099,20 @@ axes:
10961099
display_name: "PHP 7.2"
10971100
variables:
10981101
PHP_VERSION: "7.2"
1099-
- id: "7.1"
1100-
display_name: "PHP 7.1"
1102+
1103+
- id: php-edge-versions
1104+
display_name: PHP Version
1105+
values:
1106+
- id: "latest-stable"
1107+
display_name: "PHP 8.0"
11011108
variables:
1102-
PHP_VERSION: "7.1"
1109+
PHP_VERSION: "8.0"
1110+
- id: "oldest-supported"
1111+
display_name: "PHP 7.2"
1112+
variables:
1113+
PHP_VERSION: "7.2"
11031114

1104-
- id: os-php7
1115+
- id: os
11051116
display_name: OS
11061117
values:
11071118
- id: debian92-test
@@ -1143,123 +1154,131 @@ axes:
11431154
- id: libmongoc-version
11441155
display_name: libmongoc version
11451156
values:
1146-
- id: "lowest-supported"
1147-
display_name: "Lowest (1.19.1)"
1148-
variables:
1149-
LIBMONGOC_VERSION: "1.19.1"
1150-
- id: "upcoming-stable"
1151-
display_name: "latest (1.19-dev)"
1152-
variables:
1153-
LIBMONGOC_VERSION: "r1.19"
1157+
# TODO: enable lowest-supported and upcoming-stable after 1.20.0 is
1158+
# released and r1.20 is branched. As-is, r1.19 cannot be compiled because
1159+
# PHP_MONGODB_MONGOC_SOURCES conflicts with 1.20-dev (see: PHPC-2006).
1160+
#- id: "lowest-supported"
1161+
# display_name: "1.19.1"
1162+
# variables:
1163+
# LIBMONGOC_VERSION: "1.19.1"
1164+
#- id: "upcoming-stable"
1165+
# display_name: "1.19-dev"
1166+
# variables:
1167+
# LIBMONGOC_VERSION: "r1.19"
11541168
- id: "latest-dev"
1155-
display_name: "Upcoming release (1.20)"
1169+
display_name: "1.20-dev (master)"
11561170
variables:
11571171
LIBMONGOC_VERSION: "master"
11581172

11591173

11601174
buildvariants:
11611175

1162-
- matrix_name: "tests-php7"
1163-
matrix_spec: {"os-php7": "*", "edge-versions": "latest-stable", "php-versions": ["7.1","7.2","7.3"] }
1176+
# Tests all PHP versions on all operating systems and latest MongoDB version
1177+
- matrix_name: "test-php-versions"
1178+
matrix_spec: { "os": "*", "edge-versions": "latest-stable", "php-versions": "*" }
11641179
exclude_spec:
1165-
# TODO: Exclude rhel74-zseries and rhel71-power8 once latest-stable is bumped from 4.4 to 5.0
1166-
- {"os-php7": "ubuntu1804-arm64-test", "edge-versions": "latest-stable", "php-versions": ["7.1","7.2"]}
1167-
display_name: "All: ${edge-versions}/${php-versions} — ${os-php7}"
1180+
- { "os": "ubuntu1804-arm64-test", "edge-versions": "latest-stable", "php-versions": "7.2" }
1181+
# MongoDB 5.0+ is not available for rhel74-zseries and rhel71-power8
1182+
- { "os": "rhel74-zseries", "edge-versions": "latest-stable", "php-versions": "*" }
1183+
- { "os": "rhel71-power8", "edge-versions": "latest-stable", "php-versions": "*" }
1184+
display_name: "${os}, ${edge-versions}, ${php-versions}"
11681185
tasks:
1169-
- name: "test-standalone-ssl"
1170-
- name: "test-replicaset-auth"
1171-
1186+
- name: "test-standalone-ssl"
1187+
- name: "test-replicaset-auth"
11721188

1173-
- matrix_name: "mongo-30-php7"
1174-
matrix_spec: {"os-php7": "*", "versions": ["3.0", "3.2", "3.4"], "php-versions": "7.3" }
1189+
# Tests pre-3.6 MongoDB versions with oldest supported PHP version
1190+
- matrix_name: "test-old-mongodb-versions"
1191+
matrix_spec: { "os": "*", "versions": ["3.0", "3.2", "3.4"], "php-edge-versions": "oldest-supported" }
11751192
exclude_spec:
1176-
- {"os-php7": "ubuntu1804-arm64-test", "versions": ["3.0", "3.2", "3.4"], "php-versions": "7.3"}
1177-
- {"os-php7": "rhel71-power8", "versions": "3.0", "php-versions": "7.3"}
1178-
- {"os-php7": "rhel74-zseries", "versions": ["3.0", "3.2"], "php-versions": "7.3"}
1179-
display_name: "${versions}/${php-versions} — ${os-php7}"
1193+
- { "os": "ubuntu1804-arm64-test", "versions": "*", "php-edge-versions": "oldest-supported" }
1194+
- { "os": "rhel71-power8", "versions": "3.0", "php-edge-versions": "oldest-supported" }
1195+
- { "os": "rhel74-zseries", "versions": ["3.0", "3.2"], "php-edge-versions": "oldest-supported" }
1196+
display_name: "${os}, ${versions}, ${php-edge-versions}"
11801197
tasks:
1181-
- name: "test-standalone-old"
1182-
- name: "test-replicaset-old"
1183-
1198+
- name: "test-standalone-old"
1199+
- name: "test-replicaset-old"
11841200

1185-
- matrix_name: "mongo-36-php7"
1186-
matrix_spec: {"os-php7": "*", "versions": ["3.6"], "php-versions": "7.3" }
1201+
# Tests MongoDB 3.6 with oldest supported PHP version
1202+
- matrix_name: "test-mongodb-36"
1203+
matrix_spec: { "os": "*", "versions": ["3.6"], "php-edge-versions": "oldest-supported" }
11871204
exclude_spec:
1188-
- {"os-php7": "ubuntu1804-arm64-test", "versions": "3.6", "php-versions": "7.3"}
1189-
display_name: "${versions}/${php-versions} — ${os-php7}"
1205+
- { "os": "ubuntu1804-arm64-test", "versions": "*", "php-edge-versions": "oldest-supported" }
1206+
display_name: "${os}, ${versions}, ${php-edge-versions}"
11901207
tasks:
1191-
- name: "test-standalone"
1192-
- name: "test-replicaset"
1193-
- name: "test-replicaset-auth"
1194-
1208+
- name: "test-standalone"
1209+
- name: "test-replicaset"
1210+
- name: "test-replicaset-auth"
11951211

1196-
- matrix_name: "mongo-php7"
1197-
matrix_spec: {"os-php7": "*", "versions": ["4.0", "4.2", "4.4", "5.0", "latest"], "php-versions": "7.3" }
1212+
# Tests 4.0+ MongoDB versions with oldest supported PHP version
1213+
- matrix_name: "test-mongodb-versions"
1214+
matrix_spec: { "os": "*", "versions": ["4.0", "4.2", "4.4", "5.0", "latest"], "php-edge-versions": "oldest-supported" }
11981215
exclude_spec:
1199-
- {"os-php7": "rhel71-power8", "versions": ["5.0", "latest"], "php-versions": "7.3"}
1200-
- {"os-php7": "rhel74-zseries", "versions": ["4.0", "4.2", "4.4", "5.0", "latest"], "php-versions": "7.3"}
1201-
- {"os-php7": "ubuntu1804-arm64-test", "versions": "4.0", "php-versions": "7.3"}
1202-
display_name: "${versions}/${php-versions} — ${os-php7}"
1216+
- { "os": "ubuntu1804-arm64-test", "versions": "4.0", "php-edge-versions": "oldest-supported" }
1217+
- { "os": "rhel71-power8", "versions": ["5.0", "latest"], "php-edge-versions": "oldest-supported" }
1218+
# rhel74-zseries will be covered by test-mongodb-versions-nossl
1219+
- { "os": "rhel74-zseries", "versions": "*", "php-edge-versions": "oldest-supported" }
1220+
# Avoid duplicate build variants from test-php-versions (assumes edge-versions:latest-stable is 5.0)
1221+
- { "os": "*", "versions": "5.0", "php-edge-versions": "oldest-supported" }
1222+
display_name: "${os}, ${versions}, ${php-edge-versions}"
12031223
tasks:
1204-
- name: "test-standalone"
1205-
- name: "test-standalone-auth"
1206-
- name: "test-standalone-ssl"
1207-
- name: "test-replicaset"
1208-
- name: "test-replicaset-auth"
1209-
- name: "test-sharded"
1210-
1211-
- matrix_name: "mongo-php7-nossl"
1212-
matrix_spec: {"os-php7": "rhel74-zseries", "versions": ["4.2", "4.4", "5.0", "latest"], "php-versions": "7.3"}
1213-
exclude_spec:
1214-
- {"os-php7": "rhel74-zseries", "versions": ["5.0", "latest"], "php-versions": "7.3"}
1215-
display_name: "${versions}/${php-versions} — ${os-php7}"
1224+
- name: "test-standalone"
1225+
- name: "test-standalone-auth"
1226+
- name: "test-standalone-ssl"
1227+
- name: "test-replicaset"
1228+
- name: "test-replicaset-auth"
1229+
- name: "test-sharded"
1230+
1231+
# Tests MongoDB 4.2 and 4.4 on zSeries with oldest supported PHP version
1232+
- matrix_name: "test-mongodb-versions-nossl"
1233+
matrix_spec: { "os": "rhel74-zseries", "versions": ["4.2", "4.4"], "php-edge-versions": "oldest-supported" }
1234+
display_name: "${os}, ${versions}, ${php-edge-versions}"
12161235
tasks:
1217-
- name: "test-standalone"
1218-
- name: "test-standalone-auth"
1219-
- name: "test-replicaset"
1220-
- name: "test-replicaset-auth"
1221-
- name: "test-sharded"
1236+
- name: "test-standalone"
1237+
- name: "test-standalone-auth"
1238+
- name: "test-replicaset"
1239+
- name: "test-replicaset-auth"
1240+
- name: "test-sharded"
12221241

12231242
- matrix_name: "mongo-42-storage-engines"
1224-
matrix_spec: {"os-php7": "debian92-test", "versions": "4.2", "php-versions": "7.3", "storage-engine": ["wiredtiger", "inmemory"]}
1225-
display_name: "${versions}/${php-versions}/${os-php7} — ${storage-engine}"
1243+
matrix_spec: { "os": "debian92-test", "versions": "4.2", "php-edge-versions": "latest-stable", "storage-engine": "inmemory" }
1244+
display_name: "${storage-engine}: ${os}, ${versions}, ${php-edge-versions}"
12261245
tasks:
1227-
- name: "test-standalone"
1246+
- name: "test-standalone"
12281247

12291248
- matrix_name: "mongo-40-storage-engines"
1230-
matrix_spec: {"os-php7": "debian92-test", "versions": "4.0", "php-versions": "7.3", "storage-engine": "mmapv1"}
1231-
display_name: "${versions}/${php-versions}/${os-php7} — ${storage-engine}"
1249+
matrix_spec: { "os": "debian92-test", "versions": "4.0", "php-edge-versions": "latest-stable", "storage-engine": "mmapv1" }
1250+
display_name: "${storage-engine}: ${os}, ${versions}, ${php-edge-versions}"
12321251
tasks:
1233-
- name: "test-standalone"
1252+
- name: "test-standalone"
12341253

1235-
- matrix_name: "libmongoc-versions-php7"
1236-
matrix_spec: {"os-php7": "debian92-test", "edge-versions": "latest-stable", "php-versions": "7.2", "libmongoc-version": "*"}
1237-
display_name: "${edge-versions}/${php-versions}/${os-php7} — libmongoc ${libmongoc-version}"
1254+
- matrix_name: "libmongoc-versions"
1255+
matrix_spec: { "os": "debian92-test", "edge-versions": "latest-stable", "php-edge-versions": "latest-stable", "libmongoc-version": "*" }
1256+
display_name: "libmongoc ${libmongoc-version}: ${os}, ${edge-versions}, ${php-edge-versions}"
12381257
tasks:
1239-
- name: "test-standalone"
1240-
- name: "test-replicaset"
1241-
- name: "test-sharded"
1258+
- name: "test-standalone"
1259+
- name: "test-replicaset"
1260+
- name: "test-sharded"
12421261

12431262
- matrix_name: "atlas-connectivity-tests"
1244-
matrix_spec: { "os-php7": "debian92-test", "php-versions": "7.3" }
1245-
display_name: "Atlas Connectivity tests"
1263+
matrix_spec: { "os": "debian92-test", "php-edge-versions": "latest-stable" }
1264+
display_name: "Atlas Connectivity"
12461265
tasks:
12471266
- name: "test-atlas"
12481267

12491268
- matrix_name: "test-ocsp"
1250-
matrix_spec: { "os-php7": "debian92-test", "versions": ["4.4", "5.0", "latest"], "php-versions": "7.3" }
1269+
matrix_spec: { "os": "debian92-test", "versions": ["4.4", "5.0", "latest"], "php-edge-versions": "latest-stable" }
12511270
display_name: "OCSP tests - ${versions}"
12521271
tasks:
12531272
- name: ".ocsp"
12541273

12551274
- matrix_name: "test-requireApiVersion"
1256-
matrix_spec: { "os-php7": "debian92-test", "versions": ["5.0", "latest"], "php-versions": "7.3" }
1275+
matrix_spec: { "os": "debian92-test", "versions": ["5.0", "latest"], "php-edge-versions": "latest-stable" }
12571276
display_name: "Versioned API - ${versions}"
12581277
tasks:
12591278
- name: "test-requireApiVersion"
12601279

12611280
- matrix_name: "test-loadBalanced"
1262-
matrix_spec: { "os-php7": "debian92-test", "versions": ["5.0", "latest"], "php-versions": "7.3" }
1281+
matrix_spec: { "os": "debian92-test", "versions": ["5.0", "latest"], "php-edge-versions": "latest-stable" }
12631282
display_name: "Load balanced - ${versions}"
12641283
tasks:
12651284
- name: "test-loadBalanced"

bin/package.xml.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ necessary to build a fully-functional MongoDB driver.
5858
<dependencies>
5959
<required>
6060
<php>
61-
<min>7.1.0</min>
61+
<min>7.2.0</min>
6262
<max>8.99.99</max>
6363
</php>
6464
<pearinstaller>

config.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ if test "$PHP_MONGODB" != "no"; then
2020
fi
2121

2222
AC_MSG_RESULT($PHP_MONGODB_PHP_VERSION)
23-
if test "$PHP_MONGODB_PHP_VERSION_ID" -lt "70100"; then
24-
AC_MSG_ERROR([not supported. Need a PHP version >= 7.1.0 (found $PHP_MONGODB_PHP_VERSION)])
23+
if test "$PHP_MONGODB_PHP_VERSION_ID" -lt "70200"; then
24+
AC_MSG_ERROR([not supported. Need a PHP version >= 7.2.0 (found $PHP_MONGODB_PHP_VERSION)])
2525
fi
2626

2727
PHP_ARG_ENABLE([mongodb-developer-flags],

src/BSON/UTCDateTime.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,7 @@ static bool php_phongo_utcdatetime_init_from_date(php_phongo_utcdatetime_t* inte
100100

101101
/* The following assignments use the same logic as date_format() in php_date.c */
102102
sec = datetime_obj->time->sse;
103-
#if PHP_VERSION_ID >= 70200
104103
usec = (int64_t) floor(datetime_obj->time->us);
105-
#else
106-
usec = (int64_t) floor(datetime_obj->time->f * 1000000 + 0.5);
107-
#endif
108104

109105
intern->milliseconds = (sec * 1000) + (usec / 1000);
110106
intern->initialized = true;
@@ -262,11 +258,7 @@ static PHP_METHOD(UTCDateTime, toDateTime)
262258
php_date_initialize(datetime_obj, sec, sec_len, NULL, NULL, 0);
263259
efree(sec);
264260

265-
#if PHP_VERSION_ID >= 70200
266261
datetime_obj->time->us = (intern->milliseconds % 1000) * 1000;
267-
#else
268-
datetime_obj->time->f = (double) (intern->milliseconds % 1000) / 1000;
269-
#endif
270262
}
271263
/* }}} */
272264

src/MongoDB/BulkWrite.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@
2626
#include "php_phongo.h"
2727
#include "php_bson.h"
2828

29-
#if PHP_VERSION_ID < 70200
30-
#include <ext/spl/spl_iterators.h>
31-
#define zend_ce_countable spl_ce_Countable
32-
#endif /* PHP_VERSION_ID < 70200 */
33-
3429
#define PHONGO_BULKWRITE_BYPASS_UNSET -1
3530

3631
zend_class_entry* php_phongo_bulkwrite_ce;

src/MongoDB/Manager.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ static bool php_phongo_manager_merge_context_options(zval* zdriverOptions) /* {{
8383
* scope, leading to a COW violation in zend_hash_merge and
8484
* zend_symtable_str_del (called by php_array_unsetc). This macro allows
8585
* that violation in debug mode and is a NOOP when in non-debug. */
86-
#if PHP_VERSION_ID >= 70200
8786
HT_ALLOW_COW_VIOLATION(Z_ARRVAL_P(zdriverOptions));
88-
#endif
8987

9088
php_error_docref(NULL, E_DEPRECATED, "The \"context\" driver option is deprecated.");
9189

tests/cursor/bug1274-002.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,5 @@ Child exits
101101
Parent waited for child to exit
102102
Parent executes getMore with batchSize: 2
103103
OK: Got MongoDB\Driver\Exception\RuntimeException
104-
%r(Cursor not found, cursor id: \d+|cursor id \d+ not found|Cursor not found \(namespace: '.*', id: \d+\)\.)%r
104+
%r(Cursor not found, cursor id: \d+|cursor id \d+ not found|Cursor not found \(.*id: \d+\)\.)%r
105105
===DONE===

tests/cursor/bug1274-005.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,5 @@ Child exits
101101
Parent waited for child to exit
102102
Parent executes getMore with batchSize: 2
103103
OK: Got MongoDB\Driver\Exception\RuntimeException
104-
%r(Cursor not found, cursor id: \d+|cursor id \d+ not found|Cursor not found \(namespace: '.*', id: \d+\)\.)%r
104+
%r(Cursor not found, cursor id: \d+|cursor id \d+ not found|Cursor not found \(.*id: \d+\)\.)%r
105105
===DONE===

tests/cursor/cursor-tailable_error-002.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,5 @@ Awaiting results...
8686
Awaiting results...
8787
Awaiting results...
8888
OK: Got MongoDB\Driver\Exception\RuntimeException
89-
%r(Cursor not found, cursor id: \d+|cursor id \d+ not found|Cursor not found \(namespace: '.*', id: \d+\)\.)%r
89+
%r(Cursor not found, cursor id: \d+|cursor id \d+ not found|Cursor not found \(.*id: \d+\)\.)%r
9090
===DONE===

0 commit comments

Comments
 (0)