Code Duplication    Length = 12-12 lines in 2 locations

code/backends/CapistranoDeploymentBackend.php 2 locations

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