@@ -227,14 +227,14 @@ public function check( $_, $assoc_args ) {
227
227
228
228
$ command = sprintf ( '/usr/bin/env mysqlcheck%s %s ' , $ this ->get_defaults_flag_string ( $ assoc_args ), '%s ' );
229
229
WP_CLI ::debug ( "Running shell command: {$ command }" , 'db ' );
230
- WP_CLI ::debug ( 'Associative arguments: ' . json_encode ( $ assoc_args ), 'db ' );
231
230
232
231
$ assoc_args ['check ' ] = true ;
233
232
self ::run (
234
233
Utils \esc_cmd ( $ command , DB_NAME ),
235
234
$ assoc_args
236
235
);
237
236
237
+ WP_CLI ::debug ( 'Associative arguments: ' . json_encode ( $ assoc_args ), 'db ' );
238
238
WP_CLI ::success ( 'Database checked. ' );
239
239
}
240
240
@@ -271,14 +271,14 @@ public function optimize( $_, $assoc_args ) {
271
271
272
272
$ command = sprintf ( '/usr/bin/env mysqlcheck%s %s ' , $ this ->get_defaults_flag_string ( $ assoc_args ), '%s ' );
273
273
WP_CLI ::debug ( "Running shell command: {$ command }" , 'db ' );
274
- WP_CLI ::debug ( 'Associative arguments: ' . json_encode ( $ assoc_args ), 'db ' );
275
274
276
275
$ assoc_args ['optimize ' ] = true ;
277
276
self ::run (
278
277
Utils \esc_cmd ( $ command , DB_NAME ),
279
278
$ assoc_args
280
279
);
281
280
281
+ WP_CLI ::debug ( 'Associative arguments: ' . json_encode ( $ assoc_args ), 'db ' );
282
282
WP_CLI ::success ( 'Database optimized. ' );
283
283
}
284
284
@@ -315,14 +315,14 @@ public function repair( $_, $assoc_args ) {
315
315
316
316
$ command = sprintf ( '/usr/bin/env mysqlcheck%s %s ' , $ this ->get_defaults_flag_string ( $ assoc_args ), '%s ' );
317
317
WP_CLI ::debug ( "Running shell command: {$ command }" , 'db ' );
318
- WP_CLI ::debug ( 'Associative arguments: ' . json_encode ( $ assoc_args ), 'db ' );
319
318
320
319
$ assoc_args ['repair ' ] = true ;
321
320
self ::run (
322
321
Utils \esc_cmd ( $ command , DB_NAME ),
323
322
$ assoc_args
324
323
);
325
324
325
+ WP_CLI ::debug ( 'Associative arguments: ' . json_encode ( $ assoc_args ), 'db ' );
326
326
WP_CLI ::success ( 'Database repaired. ' );
327
327
}
328
328
@@ -361,12 +361,12 @@ public function cli( $_, $assoc_args ) {
361
361
362
362
$ command = sprintf ( '/usr/bin/env mysql%s --no-auto-rehash ' , $ this ->get_defaults_flag_string ( $ assoc_args ) );
363
363
WP_CLI ::debug ( "Running shell command: {$ command }" , 'db ' );
364
- WP_CLI ::debug ( 'Associative arguments: ' . json_encode ( $ assoc_args ), 'db ' );
365
364
366
365
if ( ! isset ( $ assoc_args ['database ' ] ) ) {
367
366
$ assoc_args ['database ' ] = DB_NAME ;
368
367
}
369
368
369
+ WP_CLI ::debug ( 'Associative arguments: ' . json_encode ( $ assoc_args ), 'db ' );
370
370
self ::run ( $ command , $ assoc_args );
371
371
}
372
372
@@ -427,7 +427,6 @@ public function query( $args, $assoc_args ) {
427
427
428
428
$ command = sprintf ( '/usr/bin/env mysql%s --no-auto-rehash ' , $ this ->get_defaults_flag_string ( $ assoc_args ) );
429
429
WP_CLI ::debug ( "Running shell command: {$ command }" , 'db ' );
430
- WP_CLI ::debug ( 'Associative arguments: ' . json_encode ( $ assoc_args ), 'db ' );
431
430
432
431
$ assoc_args ['database ' ] = DB_NAME ;
433
432
@@ -453,6 +452,7 @@ public function query( $args, $assoc_args ) {
453
452
$ assoc_args ['execute ' ] = $ this ->get_sql_mode_query ( $ assoc_args ) . $ assoc_args ['execute ' ];
454
453
}
455
454
455
+ WP_CLI ::debug ( 'Associative arguments: ' . json_encode ( $ assoc_args ), 'db ' );
456
456
self ::run ( $ command , $ assoc_args );
457
457
}
458
458
@@ -563,7 +563,6 @@ public function export( $args, $assoc_args ) {
563
563
564
564
$ initial_command = sprintf ( '/usr/bin/env mysqldump%s ' , $ this ->get_defaults_flag_string ( $ assoc_args ) );
565
565
WP_CLI ::debug ( "Running initial shell command: {$ initial_command }" , 'db ' );
566
- WP_CLI ::debug ( 'Associative arguments: ' . json_encode ( $ assoc_args ), 'db ' );
567
566
568
567
if ( $ support_column_statistics ) {
569
568
$ command = $ initial_command . '--skip-column-statistics %s ' ;
@@ -599,6 +598,7 @@ public function export( $args, $assoc_args ) {
599
598
// Remove parameters not needed for SQL run.
600
599
unset( $ assoc_args ['porcelain ' ] );
601
600
601
+ WP_CLI ::debug ( 'Associative arguments: ' . json_encode ( $ assoc_args ), 'db ' );
602
602
self ::run ( $ escaped_command , $ assoc_args );
603
603
604
604
if ( $ porcelain ) {
@@ -1003,7 +1003,7 @@ public function size( $args, $assoc_args ) {
1003
1003
}
1004
1004
1005
1005
if ( ! empty ( $ size_format ) && ! $ tables && ! $ format && ! $ human_readable && true !== $ all_tables && true !== $ all_tables_with_prefix ) {
1006
- WP_CLI ::Line ( filter_var ( $ rows [0 ]['Size ' ], FILTER_SANITIZE_NUMBER_INT ) );
1006
+ WP_CLI ::line ( filter_var ( $ rows [0 ]['Size ' ], FILTER_SANITIZE_NUMBER_INT ) );
1007
1007
} else {
1008
1008
// Display the rows.
1009
1009
$ args = [
@@ -1471,6 +1471,8 @@ protected function run_query( $query, $assoc_args = [] ) {
1471
1471
// Ensure that the SQL mode is compatible with WPDB.
1472
1472
$ query = $ this ->get_sql_mode_query ( $ assoc_args ) . $ query ;
1473
1473
1474
+ WP_CLI ::debug ( "Query: {$ query }" , 'db ' );
1475
+
1474
1476
self ::run (
1475
1477
sprintf (
1476
1478
'/usr/bin/env mysql%s --no-auto-rehash ' ,
0 commit comments