exec($cmd); header('Content-Type: application/x-bzip-compressed-tar'); header('Content-Disposition: attachment; filename="' . $appName . '.' . date('Y-m-d') . '.tbz"'); chdir($tmpPath); passthru("tar -cjf - ./"); exec("rm -R {$tmpPath}"); exit; } else { passthru("{$cmd} 2>&1", $cmdStatus); } Benchmark::mark("CMD finished: exitCode={$cmdStatus}"); // import build if ($cmdStatus == 0) { Benchmark::mark("importing {$buildTmpPath}"); $importResults = Emergence_FS::importTree($buildTmpPath, "sencha-build/{$appName}/{$buildType}", array('exclude' => $defaultExclude)); Benchmark::mark("imported files: " . http_build_query($importResults)); if ($framework == 'ext') { Emergence_FS::importFile("{$appTmpPath}/bootstrap.js", "{$appPath}/bootstrap.js"); Benchmark::mark("imported bootstrap.js"); } if (!empty($_GET['archive'])) { Benchmark::mark("importing {$archiveTmpPath} to {$archivePath}"); $importResults = Emergence_FS::importTree($archiveTmpPath, $archivePath); Benchmark::mark("imported files: " . http_build_query($importResults)); } } // clean up if (empty($_GET['leaveWorkspace'])) { exec("rm -R {$tmpPath}"); Benchmark::mark("erased {$tmpPath}"); }