4 // Tired of chasing typos and finding them after a commit.
5 // Run this from cmdline in basedir and quickly see if we've
6 // got any parse errors in our application files.
10 use Friendica\BaseObject;
12 error_reporting(E_ERROR | E_WARNING | E_PARSE);
13 ini_set('display_errors', '1');
14 ini_set('log_errors', '0');
18 $a = new App(dirname(__DIR__));
19 BaseObject::setApp($a);
21 @include '.htconfig.php';
23 $phpath = $a->getConfigValue('config', 'php_path', 'php');
25 echo 'Directory: src' . PHP_EOL;
26 $Iterator = new RecursiveDirectoryIterator('src');
28 foreach (new RecursiveIteratorIterator($Iterator) as $file) {
29 if (substr($file, -4) === '.php') {
30 passthru("$phpath -l $file", $ret);
35 echo "Directory: mod\n";
36 $files = glob('mod/*.php');
37 foreach ($files as $file) {
38 passthru("$phpath -l $file", $ret);
42 echo "Directory: include\n";
43 $files = glob('include/*.php');
44 foreach ($files as $file) {
45 passthru("$phpath -l $file", $ret);
49 echo "Directory: object\n";
50 $files = glob('object/*.php');
51 foreach ($files as $file) {
52 passthru("$phpath -l $file", $ret);
56 echo "Directory: addon\n";
57 $dirs = glob('addon/*');
59 foreach ($dirs as $dir) {
60 $addon = basename($dir);
61 $files = glob($dir . '/' . $addon . '.php');
62 foreach ($files as $file) {
63 passthru("$phpath -l $file", $ret);
68 echo "String files\n";
70 echo 'util/strings.php' . "\n";
71 passthru("$phpath -l util/strings.php", $ret);
74 $files = glob('view/lang/*/strings.php');
75 foreach ($files as $file) {
76 passthru("$phpath -l $file", $ret);