Code Duplication    Length = 7-7 lines in 2 locations

code/control/DNRoot.php 1 location

@@ 472-478 (lines=7) @@
469
		$dataArchive->write();
470
		$workingDir = TEMP_FOLDER . DIRECTORY_SEPARATOR . 'deploynaut-transfer-' . $dataTransfer->ID;
471
472
		$cleanupFn = function() use($workingDir, $dataTransfer, $dataArchive) {
473
			$process = new AbortableProcess(sprintf('rm -rf %s', escapeshellarg($workingDir)));
474
			$process->setTimeout(120);
475
			$process->run();
476
			$dataTransfer->delete();
477
			$dataArchive->delete();
478
		};
479
480
		// extract the sspak contents so we can inspect them
481
		try {

code/backends/CapistranoDeploymentBackend.php 1 location

@@ 421-427 (lines=7) @@
418
419
		// Rollback cleanup.
420
		$self = $this;
421
		$cleanupFn = function() use($self, $workingDir, $environment, $log) {
422
			// Rebuild makes sense even if failed - maybe we can at least partly recover.
423
			$self->rebuild($environment, $log);
424
			$process = new AbortableProcess(sprintf('rm -rf %s', escapeshellarg($workingDir)));
425
			$process->setTimeout(120);
426
			$process->run();
427
		};
428
429
		// Restore database into target environment
430
		if(in_array($dataTransfer->Mode, array('all', 'db'))) {