Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
1.7KB

  1. #!/usr/bin/env php
  2. <?php
  3. // Tired of chasing typos and finding them after a commit.
  4. // Run this from cmdline in basedir and quickly see if we've
  5. // got any parse errors in our application files.
  6. use Friendica\App;
  7. use Friendica\BaseObject;
  8. error_reporting(E_ERROR | E_WARNING | E_PARSE);
  9. ini_set('display_errors', '1');
  10. ini_set('log_errors', '0');
  11. include 'boot.php';
  12. $a = new App(dirname(__DIR__));
  13. BaseObject::setApp($a);
  14. if (x($a->config, 'php_path')) {
  15. $phpath = $a->config['php_path'];
  16. } else {
  17. $phpath = 'php';
  18. }
  19. echo 'Directory: src' . PHP_EOL;
  20. $Iterator = new RecursiveDirectoryIterator('src');
  21. foreach (new RecursiveIteratorIterator($Iterator) as $file) {
  22. if (substr($file, -4) === '.php') {
  23. passthru("$phpath -l $file", $ret);
  24. $ret === 0 || die();
  25. }
  26. }
  27. echo "Directory: mod\n";
  28. $files = glob('mod/*.php');
  29. foreach ($files as $file) {
  30. passthru("$phpath -l $file", $ret);
  31. $ret === 0 || die();
  32. }
  33. echo "Directory: include\n";
  34. $files = glob('include/*.php');
  35. foreach ($files as $file) {
  36. passthru("$phpath -l $file", $ret);
  37. $ret === 0 || die();
  38. }
  39. echo "Directory: object\n";
  40. $files = glob('object/*.php');
  41. foreach ($files as $file) {
  42. passthru("$phpath -l $file", $ret);
  43. $ret === 0 || die();
  44. }
  45. echo "Directory: addon\n";
  46. $dirs = glob('addon/*');
  47. foreach ($dirs as $dir) {
  48. $addon = basename($dir);
  49. $files = glob($dir . '/' . $addon . '.php');
  50. foreach ($files as $file) {
  51. passthru("$phpath -l $file", $ret);
  52. $ret === 0 || die();
  53. }
  54. }
  55. echo "String files\n";
  56. echo 'util/strings.php' . "\n";
  57. passthru("$phpath -l util/strings.php", $ret);
  58. $ret === 0 || die();
  59. $files = glob('view/lang/*/strings.php');
  60. foreach ($files as $file) {
  61. passthru("$phpath -l $file", $ret);
  62. $ret === 0 || die();
  63. }