Code Duplication    Length = 7-7 lines in 2 locations

code/backends/CapistranoDeploymentBackend.php 1 location

@@ 383-389 (lines=7) @@
380
381
		// Rollback cleanup.
382
		$self = $this;
383
		$cleanupFn = function() use($self, $workingDir, $environment, $log) {
384
			// Rebuild makes sense even if failed - maybe we can at least partly recover.
385
			$self->rebuild($environment, $log);
386
			$process = new AbortableProcess(sprintf('rm -rf %s', escapeshellarg($workingDir)));
387
			$process->setTimeout(120);
388
			$process->run();
389
		};
390
391
		// Restore database into target environment
392
		if(in_array($dataTransfer->Mode, array('all', 'db'))) {

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 {