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

@@ 445-451 (lines=7) @@
442
443
		// Rollback cleanup.
444
		$self = $this;
445
		$cleanupFn = function() use($self, $workingDir, $environment, $log) {
446
			// Rebuild makes sense even if failed - maybe we can at least partly recover.
447
			$self->rebuild($environment, $log);
448
			$process = new AbortableProcess(sprintf('rm -rf %s', escapeshellarg($workingDir)));
449
			$process->setTimeout(120);
450
			$process->run();
451
		};
452
453
		// Restore database into target environment
454
		if(in_array($dataTransfer->Mode, array('all', 'db'))) {