Code Duplication    Length = 12-12 lines in 2 locations

code/backends/CapistranoDeploymentBackend.php 2 locations

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