} $result = system("cp -R " . escapeshellarg($base . $source) . " " . escapeshellarg($dest->getSubPath($destination)->getPath())); if ($result === FALSE) { die("Failed"); } echo "complete\n"; } // Remove the config file from pooled directory if ($dest->contains("tests/config.php")) { $dest->getSubPath("tests/config.php")->delete(); echo "test config file deleted\n"; } $zipFile = new \r8\FileSys\File($base . "tools/RoundEights-" . r8_VERSION . ".zip"); $targzFile = new \r8\FileSys\File($base . "tools/RoundEights-" . r8_VERSION . ".tar.gz"); if ($zipFile->exists()) { echo "Removing existing zip file\n"; $zipFile->delete(); } if ($targzFile->exists()) { echo "Removing existing tar.gz file\n"; $targzFile->delete(); } // Create the archives archive echo "Creating zip archive\n"; system("cd " . escapeshellarg($tempDir) . "; " . "zip -r " . escapeshellarg($zipFile->getPath()) . " " . escapeshellarg("RoundEights")); echo "Creating tar.gz archive\n"; system("cd " . escapeshellarg($tempDir) . "; " . "tar -cvzf " . escapeshellarg($targzFile->getPath()) . " " . escapeshellarg("RoundEights")); // Purge and remove the temporary dir echo "Removing temporary directory\n"; $tempDir->purge()->delete(); echo "End of script\n";