File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -827,9 +827,8 @@ public function import( $args, $assoc_args ) {
827827 $ first_line = fgets ( $ fp );
828828 fclose ( $ fp );
829829
830- if ( 0 === strpos ( $ first_line , '/*!999999\- enable the sandbox mode */ ' ) ) {
830+ if ( false !== $ first_line && 0 === strpos ( $ first_line , '/*!999999\- enable the sandbox mode */ ' ) ) {
831831 WP_CLI ::log ( 'MariaDB sandbox mode directive detected. Skipping it by piping the file content. ' );
832-
833832 $ preamble = $ this ->get_sql_mode_query ( $ assoc_args ) . "\n" ;
834833 if ( ! Utils \get_flag_value ( $ assoc_args , 'skip-optimization ' ) ) {
835834 $ preamble .= "SET autocommit = 0; SET unique_checks = 0; SET foreign_key_checks = 0; \n" ;
@@ -852,11 +851,9 @@ public function import( $args, $assoc_args ) {
852851
853852 $ result = self ::run ( $ command , $ mysql_args );
854853
855- if ( 0 === $ result ['exit_code ' ] ) {
856- WP_CLI ::success ( sprintf ( "Imported from '%s'. " , $ result_file ) );
857- } else {
858- WP_CLI ::error ( sprintf ( "Failed to import from '%s'. " , $ result_file ) );
859- }
854+ self ::run ( $ command , $ mysql_args );
855+
856+ WP_CLI ::success ( sprintf ( "Imported from '%s'. " , $ result_file ) );
860857
861858 return ;
862859 }
You can’t perform that action at this time.
0 commit comments