@@ -260,6 +260,12 @@ public function check( $_, $assoc_args ) {
260260 WP_CLI ::debug ( "Running shell command: {$ command }" , 'db ' );
261261
262262 $ assoc_args ['check ' ] = true ;
263+
264+ // Pass --silent to mysqlcheck when in quiet mode.
265+ if ( WP_CLI ::get_config ( 'quiet ' ) ) {
266+ $ assoc_args ['silent ' ] = true ;
267+ }
268+
263269 self ::run (
264270 Utils \esc_cmd ( $ command , DB_NAME ),
265271 $ assoc_args
@@ -308,6 +314,12 @@ public function optimize( $_, $assoc_args ) {
308314 WP_CLI ::debug ( "Running shell command: {$ command }" , 'db ' );
309315
310316 $ assoc_args ['optimize ' ] = true ;
317+
318+ // Pass --silent to mysqlcheck when in quiet mode.
319+ if ( WP_CLI ::get_config ( 'quiet ' ) ) {
320+ $ assoc_args ['silent ' ] = true ;
321+ }
322+
311323 self ::run (
312324 Utils \esc_cmd ( $ command , DB_NAME ),
313325 $ assoc_args
@@ -356,6 +368,12 @@ public function repair( $_, $assoc_args ) {
356368 WP_CLI ::debug ( "Running shell command: {$ command }" , 'db ' );
357369
358370 $ assoc_args ['repair ' ] = true ;
371+
372+ // Pass --silent to mysqlcheck when in quiet mode.
373+ if ( WP_CLI ::get_config ( 'quiet ' ) ) {
374+ $ assoc_args ['silent ' ] = true ;
375+ }
376+
359377 self ::run (
360378 Utils \esc_cmd ( $ command , DB_NAME ),
361379 $ assoc_args
@@ -1143,6 +1161,12 @@ public function size( $args, $assoc_args ) {
11431161 $ size_key = floor ( log ( (float ) $ row ['Size ' ] ) / log ( 1000 ) );
11441162 $ sizes = [ 'B ' , 'KB ' , 'MB ' , 'GB ' , 'TB ' ];
11451163
1164+ if ( is_infinite ( $ size_key ) ) {
1165+ $ size_key = 0 ;
1166+ }
1167+
1168+ $ size_key = (int ) $ size_key ;
1169+
11461170 $ size_format = isset ( $ sizes [ $ size_key ] ) ? $ sizes [ $ size_key ] : $ sizes [0 ];
11471171 }
11481172
0 commit comments