From 6e787f0196f766c9d4da0cf4519c7d83699c85eb Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Thu, 3 Apr 2025 11:18:29 +0200 Subject: [PATCH] Do not error if mysql binary not found --- php/utils.php | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/php/utils.php b/php/utils.php index 16462fed1e..21827bf389 100644 --- a/php/utils.php +++ b/php/utils.php @@ -1245,7 +1245,7 @@ static function ( $arg ) { break; } } - return $arg; + return $arg; }, $argv ); @@ -1411,8 +1411,8 @@ function glob_brace( $pattern, $dummy_flags = null ) { // phpcs:ignore Generic.C // For each comma-separated subpattern. do { $subpattern = substr( $pattern, 0, $begin ) - . substr( $pattern, $p, $next - $p ) - . substr( $pattern, $rest + 1 ); + . substr( $pattern, $p, $next - $p ) + . substr( $pattern, $rest + 1 ); $result = glob_brace( $subpattern ); if ( ! empty( $result ) ) { @@ -1889,10 +1889,6 @@ function get_mysql_binary_path() { $path = $mariadb_binary; } - if ( '' === $path ) { - WP_CLI::Error( 'Could not find mysql binary' ); - } - return $path; } @@ -1927,19 +1923,19 @@ function get_mysql_version() { } /** - * Returns the correct `dump` command based on the detected database type. - * - * @return string The appropriate dump command. - */ + * Returns the correct `dump` command based on the detected database type. + * + * @return string The appropriate dump command. + */ function get_sql_dump_command() { return 'mariadb' === get_db_type() ? 'mariadb-dump' : 'mysqldump'; } /** - * Returns the correct `check` command based on the detected database type. - * - * @return string The appropriate check command. - */ + * Returns the correct `check` command based on the detected database type. + * + * @return string The appropriate check command. + */ function get_sql_check_command() { return 'mariadb' === get_db_type() ? 'mariadb-check' : 'mysqlcheck'; }