Code Duplication    Length = 12-12 lines in 2 locations

code/backends/CapistranoDeploymentBackend.php 2 locations

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