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 error_reporting(E_ERROR | E_WARNING | E_PARSE);
11 ini_set('display_errors', '1');
12 ini_set('log_errors', '0');
17 $a = new App(dirname(__DIR__));
20 if (x($a->config, 'php_path')) {
21 $phpath = $a->config['php_path'];
26 echo 'Directory: src' . PHP_EOL;
27 $Iterator = new RecursiveDirectoryIterator('src');
29 foreach (new RecursiveIteratorIterator($Iterator) as $file) {
30 if (substr($file, -4) === '.php') {
31 passthru("$phpath -l $file", $ret);
36 echo "Directory: mod\n";
37 $files = glob('mod/*.php');
38 foreach ($files as $file) {
39 passthru("$phpath -l $file", $ret);
43 echo "Directory: include\n";
44 $files = glob('include/*.php');
45 foreach ($files as $file) {
46 passthru("$phpath -l $file", $ret);
50 echo "Directory: object\n";
51 $files = glob('object/*.php');
52 foreach ($files as $file) {
53 passthru("$phpath -l $file", $ret);
57 echo "Directory: addon\n";
58 $dirs = glob('addon/*');
60 foreach ($dirs as $dir) {
61 $addon = basename($dir);
62 $files = glob($dir . '/' . $addon . '.php');
63 foreach ($files as $file) {
64 passthru("$phpath -l $file", $ret);
69 echo "String files\n";
71 echo 'util/strings.php' . "\n";
72 passthru("$phpath -l util/strings.php", $ret);
75 $files = glob('view/lang/*/strings.php');
76 foreach ($files as $file) {
77 passthru("$phpath -l $file", $ret);