Code Duplication    Length = 12-12 lines in 2 locations

code/backends/CapistranoDeploymentBackend.php 2 locations

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