Bootswatch, Summernote, and Captcheck mods for Mods for HESK (mods-for-hesk.com). In use at support.netsyms.com.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

deploy_release_to_github.php 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. $zip_name = "release.zip";
  3. if (!extension_loaded("zip")) {
  4. die("Cannot zip file contents!");
  5. }
  6. $zip = new ZipArchive();
  7. $res = $zip->open($zip_name, ZipArchive::CREATE);
  8. if ($res !== true) {
  9. die("Failed to create zip!\n");
  10. }
  11. // Create recursive directory iterator
  12. /** @var SplFileInfo[] $files */
  13. $files = new RecursiveIteratorIterator(
  14. new RecursiveDirectoryIterator("../"),
  15. RecursiveIteratorIterator::LEAVES_ONLY
  16. );
  17. foreach ($files as $name => $file)
  18. {
  19. echo "\nWorking with file " . $file->getFilename() . "\n";
  20. continue;
  21. if (substr($file->getFilename(), 0, strlen($file->getFilename())) === "." ||
  22. strtolower($file->getFilename()) === 'attachments' ||
  23. strtolower($file->getFilename()) === "contributing.md" ||
  24. strtolower($file->getFilename() === "ci") ||
  25. strtolower($file->getFilename() === "apidoc.json")) {
  26. //-- Don"t compress . files
  27. echo "Skipped file.\n";
  28. continue;
  29. }
  30. // Skip directories (they would be added automatically)
  31. if (!$file->isDir())
  32. {
  33. // Get real and relative path for current file
  34. $filePath = $file->getRealPath();
  35. $relativePath = substr($filePath, strlen("../") + 1);
  36. // Add current file to archive
  37. $zip->addFile($filePath, $relativePath);
  38. } else {
  39. echo "Skipped directory " . $file->getFilename() . "\n";
  40. }
  41. }