| @@ 103-117 (lines=15) @@ | ||
| 100 | * @param string $connector |
|
| 101 | * @return void |
|
| 102 | */ |
|
| 103 | protected function putSql(string $path, string $connector) |
|
| 104 | { |
|
| 105 | $exec = 'export MYSQL_PWD=\'%s\'; mysql -u %s -h %s --port %s %s < %s'; |
|
| 106 | ||
| 107 | $command = sprintf($exec, |
|
| 108 | addcslashes(config('database.connections.' . $connector . '.password'), "'"), |
|
| 109 | config('database.connections.' . $connector . '.username'), |
|
| 110 | config('database.connections.' . $connector . '.host'), |
|
| 111 | config('database.connections.' . $connector . '.port'), |
|
| 112 | config('database.connections.' . $connector . '.database'), |
|
| 113 | $path |
|
| 114 | ); |
|
| 115 | ||
| 116 | exec($command); |
|
| 117 | } |
|
| 118 | } |
|
| 119 | ||
| @@ 89-103 (lines=15) @@ | ||
| 86 | * @param string $connector |
|
| 87 | * @return void |
|
| 88 | */ |
|
| 89 | protected function putSql(string $path, string $connector) |
|
| 90 | { |
|
| 91 | $exec = 'export MYSQL_PWD=\'%s\'; mysql -u %s -h %s --port %s %s < %s'; |
|
| 92 | ||
| 93 | $command = sprintf($exec, |
|
| 94 | addcslashes(config('database.connections.' . $connector . '.password'),"'"), |
|
| 95 | config('database.connections.' . $connector . '.username'), |
|
| 96 | config('database.connections.' . $connector . '.host'), |
|
| 97 | config('database.connections.' . $connector . '.port'), |
|
| 98 | config('database.connections.' . $connector . '.database'), |
|
| 99 | $path |
|
| 100 | ); |
|
| 101 | ||
| 102 | exec($command); |
|
| 103 | } |
|
| 104 | } |
|
| 105 | ||