File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -336,7 +336,7 @@ protected function sqlite_export( $file, $assoc_args ) {
336336 foreach ( $ exclude_tables as $ table ) {
337337 // Escape double quotes within the table name and wrap it in double quotes.
338338 $ escaped_identifier = '" ' . str_replace ( '" ' , '"" ' , $ table ) . '" ' ;
339- $ drop_statements [] = sprintf ( 'DROP TABLE %s; ' , $ escaped_identifier );
339+ $ drop_statements [] = sprintf ( 'DROP TABLE %s; ' , $ escaped_identifier );
340340 }
341341
342342 if ( ! empty ( $ drop_statements ) ) {
@@ -370,17 +370,15 @@ protected function sqlite_export( $file, $assoc_args ) {
370370 if ( $ stdout ) {
371371 readfile ( $ export_db );
372372 unlink ( $ export_db );
373- } else {
374- if ( ! @rename ( $ export_db , $ file ) ) {
373+ } elseif ( ! @rename ( $ export_db , $ file ) ) {
375374 // Clean up temporary files and surface a clear error if the export cannot be moved.
376- if ( file_exists ( $ export_db ) ) {
377- unlink ( $ export_db );
378- }
379- if ( file_exists ( $ temp_db ) ) {
380- unlink ( $ temp_db );
381- }
382- WP_CLI ::error ( "Could not move exported database to ' {$ file }'. Please check that the path is writable and on the same filesystem. " );
375+ if ( file_exists ( $ export_db ) ) {
376+ unlink ( $ export_db );
377+ }
378+ if ( file_exists ( $ temp_db ) ) {
379+ unlink ( $ temp_db );
383380 }
381+ WP_CLI ::error ( "Could not move exported database to ' {$ file }'. Please check that the path is writable and on the same filesystem. " );
384382 }
385383 unlink ( $ temp_db );
386384
You can’t perform that action at this time.
0 commit comments