Closed wojtekn closed 1 year ago
It fixes https://github.com/wp-cli/config-command/issues/152
In this diff, I propose to change the way of validating MySQL connection from the CLI command call to the native PHP function.
$wpdb is not accessible, so I used the native mysqli function, similar to what happens in $wpdb->db_connect().
$wpdb
$wpdb->db_connect()
Testing steps
wp-config.php
../config-command/vendor/bin/wp config create --dbname=test --dbuser=test --dbpass=wrongpassword --locale=ro_RO --dbhost=127.0.0.1
Error (1045) Access denied for user 'test'@'172.17.0.1' (using password: YES)%
Success: Generated 'wp-config.php' file.
@wojtekn , can you please provide some test instructions here?
It fixes https://github.com/wp-cli/config-command/issues/152
In this diff, I propose to change the way of validating MySQL connection from the CLI command call to the native PHP function.
$wpdb
is not accessible, so I used the native mysqli function, similar to what happens in$wpdb->db_connect()
.Testing steps
wp-config.php
if it exists