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');
16 $a = new App(dirname(__DIR__));
18 if (x($a->config, 'php_path')) {
19 $phpath = $a->config['php_path'];
24 echo 'Directory: src' . PHP_EOL;
25 $Iterator = new RecursiveDirectoryIterator('src');
27 foreach (new RecursiveIteratorIterator($Iterator) as $file) {
28 if (substr($file, -4) === '.php') {
29 passthru("$phpath -l $file", $ret);
34 echo "Directory: mod\n";
35 $files = glob('mod/*.php');
36 foreach ($files as $file) {
37 passthru("$phpath -l $file", $ret);
41 echo "Directory: include\n";
42 $files = glob('include/*.php');
43 foreach ($files as $file) {
44 passthru("$phpath -l $file", $ret);
48 echo "Directory: object\n";
49 $files = glob('object/*.php');
50 foreach ($files as $file) {
51 passthru("$phpath -l $file", $ret);
55 echo "Directory: addon\n";
56 $dirs = glob('addon/*');
58 foreach ($dirs as $dir) {
59 $addon = basename($dir);
60 $files = glob($dir . '/' . $addon . '.php');
61 foreach ($files as $file) {
62 passthru("$phpath -l $file", $ret);
67 echo "String files\n";
69 echo 'util/strings.php' . "\n";
70 passthru("$phpath -l util/strings.php", $ret);
73 $files = glob('view/lang/*/strings.php');
74 foreach ($files as $file) {
75 passthru("$phpath -l $file", $ret);