1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-10-31 14:10:08 +00:00

Adding PHP Syntax Check to build.php

This commit is contained in:
Tim Düsterhus 2012-03-09 21:23:17 +01:00
parent 6e89b04751
commit f26fa50bd6

View File

@ -43,12 +43,34 @@
}
echo <<<EOT
Checking PHP for Syntax Errors
------------------------------
EOT;
chdir('file');
$check = null;
$check = function ($folder) use (&$check) {
if (is_file($folder)) {
if (substr($folder, -4) === '.php') {
passthru('php -l '.escapeshellarg($folder), $code);
if ($code != 0) exit($code);
}
return;
}
$files = glob($folder.'/*');
foreach ($files as $file) {
$check($file);
}
};
$check('.');
echo <<<EOT
Building file.tar
-----------------
EOT;
chdir('file');
passthru('tar cvf ../file.tar * --exclude=*.coffee --exclude=*.scss', $code);
passthru('tar cvf ../file.tar * --exclude=*.coffee --exclude=*.scss --exclude=.sass-cache', $code);
if ($code != 0) exit($code);
echo <<<EOT