]> git.mxchange.org Git - friendica.git/blob - util/typo.php
Cleanup /format pre-move
[friendica.git] / util / typo.php
1 <?php
2 // Tired of chasing typos and finding them after a commit.
3 // Run this from cmdline in basedir and quickly see if we've
4 // got any parse errors in our application files.
5
6
7 error_reporting(E_ERROR | E_WARNING | E_PARSE );
8 ini_set('display_errors', '1');
9 ini_set('log_errors','0');
10
11 include 'boot.php';
12
13 $a = new App();
14
15 if(x($a->config,'php_path'))
16         $phpath = $a->config['php_path'];
17 else
18         $phpath = 'php';
19
20
21 echo "Directory: mod\n";
22 $files = glob('mod/*.php');
23 foreach($files as $file) {
24         passthru("$phpath -l $file", $ret); $ret===0 or die();
25 }
26
27 echo "Directory: include\n";
28 $files = glob('include/*.php');
29 foreach($files as $file) {
30         passthru("$phpath -l $file", $ret); $ret===0 or die();
31 }
32
33 echo "Directory: object\n";
34 $files = glob('object/*.php');
35 foreach($files as $file) {
36         passthru("$phpath -l $file", $ret); $ret===0 or die();
37 }
38
39 echo "Directory: addon\n";
40 $dirs = glob('addon/*');
41
42 foreach($dirs as $dir) {
43         $addon = basename($dir);
44         $files = glob($dir . '/' . $addon . '.php');
45         foreach($files as $file) {
46                 passthru("$phpath -l $file", $ret); $ret===0 or die();
47         }
48 }
49
50
51 echo "String files\n";
52
53 echo 'util/strings.php' . "\n";
54 passthru("$phpath -l util/strings.php", $ret); $ret===0 or die();
55
56 $files = glob('view/lang/*/strings.php');
57 foreach($files as $file) {
58         passthru("$phpath -l $file", $ret); $ret===0 or die();
59 }