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

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