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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. $root = preg_replace('/\/[^\/]+$/', '', dirname(__FILE__));
  3. $directories = [
  4. "{$root}/src/"
  5. ];
  6. $files = [
  7. "options.js",
  8. "popup.js",
  9. "options.css",
  10. "popup.css",
  11. "options.html",
  12. "popup.html",
  13. ];
  14. $additional_files = [
  15. ];
  16. $characters = [ ];
  17. function process_file($filename) {
  18. if (!file_exists($filename))
  19. return;
  20. global $characters;
  21. $contents = file_get_contents($filename);
  22. preg_match_all('/&#x(.{4})/', $contents, $matches);
  23. $characters = array_merge($characters, $matches[1]);
  24. preg_match_all('/\\\(F.{3})/', $contents, $matches);
  25. $characters = array_merge($characters, $matches[1]);
  26. }
  27. foreach ($directories as $directory) {
  28. foreach ($files as $file) {
  29. process_file($directory.$file);
  30. }
  31. }
  32. foreach ($additional_files as $file) {
  33. process_file($file);
  34. }
  35. foreach ($characters as $key => $value) {
  36. $characters[$key] = strtoupper($value);
  37. }
  38. $characters = array_unique($characters);
  39. sort($characters);
  40. echo implode(",",$characters);
  41. echo "\n";
  42. ?>