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.

79 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. @include '.htconfig.php';
  15. $phpath = $a->getConfigValue('config', 'php_path', 'php');
  16. echo 'Directory: src' . PHP_EOL;
  17. $Iterator = new RecursiveDirectoryIterator('src');
  18. foreach (new RecursiveIteratorIterator($Iterator) as $file) {
  19. if (substr($file, -4) === '.php') {
  20. passthru("$phpath -l $file", $ret);
  21. $ret === 0 || die();
  22. }
  23. }
  24. echo "Directory: mod\n";
  25. $files = glob('mod/*.php');
  26. foreach ($files as $file) {
  27. passthru("$phpath -l $file", $ret);
  28. $ret === 0 || die();
  29. }
  30. echo "Directory: include\n";
  31. $files = glob('include/*.php');
  32. foreach ($files as $file) {
  33. passthru("$phpath -l $file", $ret);
  34. $ret === 0 || die();
  35. }
  36. echo "Directory: object\n";
  37. $files = glob('object/*.php');
  38. foreach ($files as $file) {
  39. passthru("$phpath -l $file", $ret);
  40. $ret === 0 || die();
  41. }
  42. echo "Directory: addon\n";
  43. $dirs = glob('addon/*');
  44. foreach ($dirs as $dir) {
  45. $addon = basename($dir);
  46. $files = glob($dir . '/' . $addon . '.php');
  47. foreach ($files as $file) {
  48. passthru("$phpath -l $file", $ret);
  49. $ret === 0 || die();
  50. }
  51. }
  52. echo "String files\n";
  53. echo 'util/strings.php' . "\n";
  54. passthru("$phpath -l util/strings.php", $ret);
  55. $ret === 0 || die();
  56. $files = glob('view/lang/*/strings.php');
  57. foreach ($files as $file) {
  58. passthru("$phpath -l $file", $ret);
  59. $ret === 0 || die();
  60. }