Code Duplication    Length = 12-12 lines in 2 locations

code/backends/CapistranoDeploymentBackend.php 2 locations

@@ 354-365 (lines=12) @@
351
		$databasePath = $filepathBase . DIRECTORY_SEPARATOR . 'database.sql.gz';
352
353
		// Backup database
354
		if(in_array($dataTransfer->Mode, array('all', 'db'))) {
355
			$log->write(sprintf('Backup of database from "%s" started', $name));
356
			$command = $this->getCommand('data:getdb', 'db', $environment, array('data_path' => $databasePath), $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 database from "%s" done', $name));
365
		}
366
367
		// Backup assets
368
		if(in_array($dataTransfer->Mode, array('all', 'assets'))) {
@@ 368-379 (lines=12) @@
365
		}
366
367
		// Backup assets
368
		if(in_array($dataTransfer->Mode, array('all', 'assets'))) {
369
			$log->write(sprintf('Backup of assets from "%s" started', $name));
370
			$command = $this->getCommand('data:getassets', 'web', $environment, array('data_path' => $filepathBase), $log);
371
			$command->run(function($type, $buffer) use($log) {
372
				$log->write($buffer);
373
			});
374
			if(!$command->isSuccessful()) {
375
				$this->extend('dataTransferFailure', $environment, $log);
376
				throw new RuntimeException($command->getErrorOutput());
377
			}
378
			$log->write(sprintf('Backup of assets from "%s" done', $name));
379
		}
380
381
		// ensure the database connection is re-initialised, which is needed if the transfer
382
		// above took a really long time because the handle to the db may have become invalid.