Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
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.

78 lines
1.6KB

  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. error_reporting(E_ERROR | E_WARNING | E_PARSE);
  8. ini_set('display_errors', '1');
  9. ini_set('log_errors', '0');
  10. include 'boot.php';
  11. $a = new App(dirname(__DIR__));
  12. if (x($a->config, 'php_path')) {
  13. $phpath = $a->config['php_path'];
  14. } else {
  15. $phpath = 'php';
  16. }
  17. echo 'Directory: src' . PHP_EOL;
  18. $Iterator = new RecursiveDirectoryIterator('src');
  19. foreach (new RecursiveIteratorIterator($Iterator) as $file) {
  20. if (substr($file, -4) === '.php') {
  21. passthru("$phpath -l $file", $ret);
  22. $ret === 0 || die();
  23. }
  24. }
  25. echo "Directory: mod\n";
  26. $files = glob('mod/*.php');
  27. foreach ($files as $file) {
  28. passthru("$phpath -l $file", $ret);
  29. $ret === 0 || die();
  30. }
  31. echo "Directory: include\n";
  32. $files = glob('include/*.php');
  33. foreach ($files as $file) {
  34. passthru("$phpath -l $file", $ret);
  35. $ret === 0 || die();
  36. }
  37. echo "Directory: object\n";
  38. $files = glob('object/*.php');
  39. foreach ($files as $file) {
  40. passthru("$phpath -l $file", $ret);
  41. $ret === 0 || die();
  42. }
  43. echo "Directory: addon\n";
  44. $dirs = glob('addon/*');
  45. foreach ($dirs as $dir) {
  46. $addon = basename($dir);
  47. $files = glob($dir . '/' . $addon . '.php');
  48. foreach ($files as $file) {
  49. passthru("$phpath -l $file", $ret);
  50. $ret === 0 || die();
  51. }
  52. }
  53. echo "String files\n";
  54. echo 'util/strings.php' . "\n";
  55. passthru("$phpath -l util/strings.php", $ret);
  56. $ret === 0 || die();
  57. $files = glob('view/lang/*/strings.php');
  58. foreach ($files as $file) {
  59. passthru("$phpath -l $file", $ret);
  60. $ret === 0 || die();
  61. }