|
@@ 301-312 (lines=12) @@
|
| 298 |
|
$databasePath = $filepathBase . DIRECTORY_SEPARATOR . 'database.sql'; |
| 299 |
|
|
| 300 |
|
// Backup database |
| 301 |
|
if(in_array($dataTransfer->Mode, array('all', 'db'))) { |
| 302 |
|
$log->write(sprintf('Backup of database from "%s" started', $name)); |
| 303 |
|
$command = $this->getCommand('data:getdb', 'db', $environment, array('data_path' => $databasePath), $log); |
| 304 |
|
$command->run(function($type, $buffer) use($log) { |
| 305 |
|
$log->write($buffer); |
| 306 |
|
}); |
| 307 |
|
if(!$command->isSuccessful()) { |
| 308 |
|
$this->extend('dataTransferFailure', $environment, $log); |
| 309 |
|
throw new RuntimeException($command->getErrorOutput()); |
| 310 |
|
} |
| 311 |
|
$log->write(sprintf('Backup of database from "%s" done', $name)); |
| 312 |
|
} |
| 313 |
|
|
| 314 |
|
// Backup assets |
| 315 |
|
if(in_array($dataTransfer->Mode, array('all', 'assets'))) { |
|
@@ 315-326 (lines=12) @@
|
| 312 |
|
} |
| 313 |
|
|
| 314 |
|
// Backup assets |
| 315 |
|
if(in_array($dataTransfer->Mode, array('all', 'assets'))) { |
| 316 |
|
$log->write(sprintf('Backup of assets from "%s" started', $name)); |
| 317 |
|
$command = $this->getCommand('data:getassets', 'web', $environment, array('data_path' => $filepathBase), $log); |
| 318 |
|
$command->run(function($type, $buffer) use($log) { |
| 319 |
|
$log->write($buffer); |
| 320 |
|
}); |
| 321 |
|
if(!$command->isSuccessful()) { |
| 322 |
|
$this->extend('dataTransferFailure', $environment, $log); |
| 323 |
|
throw new RuntimeException($command->getErrorOutput()); |
| 324 |
|
} |
| 325 |
|
$log->write(sprintf('Backup of assets from "%s" done', $name)); |
| 326 |
|
} |
| 327 |
|
|
| 328 |
|
// ensure the database connection is re-initialised, which is needed if the transfer |
| 329 |
|
// above took a really long time because the handle to the db may have become invalid. |