|
@@ 340-351 (lines=12) @@
|
| 337 |
|
$databasePath = $filepathBase . DIRECTORY_SEPARATOR . 'database.sql.gz'; |
| 338 |
|
|
| 339 |
|
// Backup database |
| 340 |
|
if(in_array($dataTransfer->Mode, array('all', 'db'))) { |
| 341 |
|
$log->write(sprintf('Backup of database from "%s" started', $name)); |
| 342 |
|
$command = $this->getCommand('data:getdb', 'db', $environment, array('data_path' => $databasePath), $log); |
| 343 |
|
$command->run(function($type, $buffer) use($log) { |
| 344 |
|
$log->write($buffer); |
| 345 |
|
}); |
| 346 |
|
if(!$command->isSuccessful()) { |
| 347 |
|
$this->extend('dataTransferFailure', $environment, $log); |
| 348 |
|
throw new RuntimeException($command->getErrorOutput()); |
| 349 |
|
} |
| 350 |
|
$log->write(sprintf('Backup of database from "%s" done', $name)); |
| 351 |
|
} |
| 352 |
|
|
| 353 |
|
// Backup assets |
| 354 |
|
if(in_array($dataTransfer->Mode, array('all', 'assets'))) { |
|
@@ 354-365 (lines=12) @@
|
| 351 |
|
} |
| 352 |
|
|
| 353 |
|
// Backup assets |
| 354 |
|
if(in_array($dataTransfer->Mode, array('all', 'assets'))) { |
| 355 |
|
$log->write(sprintf('Backup of assets from "%s" started', $name)); |
| 356 |
|
$command = $this->getCommand('data:getassets', 'web', $environment, array('data_path' => $filepathBase), $log); |
| 357 |
|
$command->run(function($type, $buffer) use($log) { |
| 358 |
|
$log->write($buffer); |
| 359 |
|
}); |
| 360 |
|
if(!$command->isSuccessful()) { |
| 361 |
|
$this->extend('dataTransferFailure', $environment, $log); |
| 362 |
|
throw new RuntimeException($command->getErrorOutput()); |
| 363 |
|
} |
| 364 |
|
$log->write(sprintf('Backup of assets from "%s" done', $name)); |
| 365 |
|
} |
| 366 |
|
|
| 367 |
|
// ensure the database connection is re-initialised, which is needed if the transfer |
| 368 |
|
// above took a really long time because the handle to the db may have become invalid. |