Code Duplication    Length = 7-7 lines in 2 locations

code/control/DNRoot.php 1 location

@@ 454-460 (lines=7) @@
451
		$dataArchive->write();
452
		$workingDir = TEMP_FOLDER . DIRECTORY_SEPARATOR . 'deploynaut-transfer-' . $dataTransfer->ID;
453
454
		$cleanupFn = function () use ($workingDir, $dataTransfer, $dataArchive) {
455
			$process = new AbortableProcess(sprintf('rm -rf %s', escapeshellarg($workingDir)));
456
			$process->setTimeout(120);
457
			$process->run();
458
			$dataTransfer->delete();
459
			$dataArchive->delete();
460
		};
461
462
		// extract the sspak contents so we can inspect them
463
		try {

code/backends/CapistranoDeploymentBackend.php 1 location

@@ 431-437 (lines=7) @@
428
429
		// Rollback cleanup.
430
		$self = $this;
431
		$cleanupFn = function() use($self, $workingDir, $environment, $log) {
432
			// Rebuild makes sense even if failed - maybe we can at least partly recover.
433
			$self->rebuild($environment, $log);
434
			$process = new AbortableProcess(sprintf('rm -rf %s', escapeshellarg($workingDir)));
435
			$process->setTimeout(120);
436
			$process->run();
437
		};
438
439
		// Restore database into target environment
440
		if(in_array($dataTransfer->Mode, array('all', 'db'))) {