Skip to content

Commit ab2efda

Browse files
Tsvetan StoychevTsvetan Stoychev
authored andcommitted
Make WordPress test installer client portable
1 parent 1bee9d9 commit ab2efda

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

tools/install-wp-tests.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ TMPDIR=$(echo "$TMPDIR" | sed -e "s/\/$//")
1717
WP_TESTS_DIR=${WP_TESTS_DIR-$TMPDIR/wordpress-tests-lib}
1818
WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR/wordpress}
1919

20+
if mysql --help 2>&1 | grep -q -- '--ssl-mode'; then
21+
MYSQL_SSL_OPTION=' --ssl-mode=DISABLED'
22+
else
23+
MYSQL_SSL_OPTION=' --ssl=0'
24+
fi
25+
2026
download() {
2127
if [ "$(command -v curl)" ]; then
2228
curl -s "$1" > "$2"
@@ -142,11 +148,11 @@ install_db() {
142148

143149
if ! [ -z "$DB_HOSTNAME" ]; then
144150
if [ "$(echo "$DB_SOCK_OR_PORT" | grep -e '^[0-9]\{1,\}$')" ]; then
145-
EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp --skip-ssl"
151+
EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp$MYSQL_SSL_OPTION"
146152
elif ! [ -z "$DB_SOCK_OR_PORT" ]; then
147153
EXTRA=" --socket=$DB_SOCK_OR_PORT"
148154
else
149-
EXTRA=" --host=$DB_HOSTNAME --protocol=tcp --skip-ssl"
155+
EXTRA=" --host=$DB_HOSTNAME --protocol=tcp$MYSQL_SSL_OPTION"
150156
fi
151157
fi
152158

0 commit comments

Comments
 (0)