2323
2424use function array_splice ;
2525use function getcwd ;
26+ use function implode ;
2627use function iterator_to_array ;
2728use function sprintf ;
2829use function Symfony \Component \String \u ;
@@ -112,12 +113,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int
112113 getcwd () :
113114 throw new RuntimeException ('Unable to get the current directory, check the user permissions ' )
114115 ;
115-
116+
116117 $ dumpOnlyData = $ backup ->getStrategy ()->getOnlyData ();
117118 $ backupTables = $ backup ->getStrategy ()->getTables ();
118-
119+
119120 $ io ->info (sprintf ('The backup %s is in progress ' , $ backupName ));
120-
121+
121122 foreach ($ connection ->getDatabases () as $ database ) {
122123 if ($ output ->isVerbose ()) {
123124 $ io ->comment ("Backup for $ database database has started " );
@@ -127,13 +128,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
127128 $ filePath = "$ backupDirectory/ $ backupName- $ database- $ date.sql " ;
128129
129130 $ process = Process::fromShellCommandline (
130- \ sprintf (
131+ sprintf (
131132 '"${:MYSQL_DUMP}" -u "${:DB_USER}" -h "${:DB_HOST}" -P "${:DB_PORT}" %s "${:DB_NAME}" %s > "${:FILEPATH}" ' ,
132133 $ dumpOnlyData ? '--no-create-info ' : '' ,
133- \ implode (' ' , $ backupTables )
134+ implode (' ' , $ backupTables )
134135 )
135136 );
136-
137+
137138 $ process ->setPty (Process::isPtySupported ());
138139 $ process ->run (null , [
139140 'MYSQL_DUMP ' => $ mysqldump ,
@@ -144,7 +145,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
144145 'MYSQL_PWD ' => $ connection ->getPassword (),
145146 'FILEPATH ' => $ filePath ,
146147 ]);
147-
148+
148149 if (!$ process ->isSuccessful ()) {
149150 $ message = '' !== $ process ->getErrorOutput () ? $ process ->getErrorOutput () : $ process ->getOutput ();
150151
0 commit comments