Code Duplication    Length = 7-7 lines in 2 locations

code/backends/CapistranoDeploymentBackend.php 1 location

@@ 422-428 (lines=7) @@
419
420
		// Rollback cleanup.
421
		$self = $this;
422
		$cleanupFn = function() use($self, $workingDir, $environment, $log) {
423
			// Rebuild makes sense even if failed - maybe we can at least partly recover.
424
			$self->rebuild($environment, $log);
425
			$process = new AbortableProcess(sprintf('rm -rf %s', escapeshellarg($workingDir)));
426
			$process->setTimeout(120);
427
			$process->run();
428
		};
429
430
		// Restore database into target environment
431
		if(in_array($dataTransfer->Mode, array('all', 'db'))) {

code/control/DNRoot.php 1 location

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