Code Duplication    Length = 7-7 lines in 2 locations

code/backends/CapistranoDeploymentBackend.php 1 location

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

code/control/DNRoot.php 1 location

@@ 486-492 (lines=7) @@
483
		$dataArchive->write();
484
		$workingDir = TEMP_FOLDER . DIRECTORY_SEPARATOR . 'deploynaut-transfer-' . $dataTransfer->ID;
485
486
		$cleanupFn = function () use ($workingDir, $dataTransfer, $dataArchive) {
487
			$process = new AbortableProcess(sprintf('rm -rf %s', escapeshellarg($workingDir)));
488
			$process->setTimeout(120);
489
			$process->run();
490
			$dataTransfer->delete();
491
			$dataArchive->delete();
492
		};
493
494
		// extract the sspak contents so we can inspect them
495
		try {