Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/DB_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ public function cli( $_, $assoc_args ) {
}

WP_CLI::debug( 'Associative arguments: ' . json_encode( $assoc_args ), 'db' );
self::run( $command, $assoc_args );
self::run( $command, $assoc_args, null, true );
}

/**
Expand Down Expand Up @@ -1480,6 +1480,9 @@ protected function run_query( $query, $assoc_args = [] ) {
* use.
* @param bool $send_to_shell Optional. Whether to send STDOUT and STDERR
* immediately to the shell. Defaults to true.
* @param bool $interactive Optional. Whether MySQL is meant to be
* executed as an interactive process. Defaults
* to false.
*
* @return array {
* Associative array containing STDOUT and STDERR output.
Expand All @@ -1489,7 +1492,7 @@ protected function run_query( $query, $assoc_args = [] ) {
* @type int $exit_code Exit code of the process.
* }
*/
private static function run( $cmd, $assoc_args = [], $send_to_shell = true ) {
private static function run( $cmd, $assoc_args = [], $send_to_shell = true, $interactive = false ) {
$required = [
'host' => DB_HOST,
'user' => DB_USER,
Expand All @@ -1513,7 +1516,7 @@ private static function run( $cmd, $assoc_args = [], $send_to_shell = true ) {

$final_args = array_merge( $assoc_args, $required );

return Utils\run_mysql_command( $cmd, $final_args, null, $send_to_shell );
return Utils\run_mysql_command( $cmd, $final_args, null, $send_to_shell, $interactive );
}

/**
Expand Down