Syntax Checking
Posted: Fri Feb 03, 2006 1:43 pm
I've noticed that if I use command line php syntax checking it causes major load time on my script. However, since I develop for mostly php 4 users there is no built in command for file syntax checking. So I was wondering if anyone has any ideas as to how I could possibly run a syntax checking at a decent speed.
Thanks,
Brad Bridges
The following is the function I was using that causes lag:
Thanks,
Brad Bridges
The following is the function I was using that causes lag:
Code: Select all
function def_checkFile($filename,$checkSyntax = false){
if (!file_exists($filename)) {
return false;
}
if ($checkSyntax) {
$command = 'php -l ' . $filename;
$output = shell_exec($command);
if (strpos($output, 'No syntax errors detected in') !== false){
return(true);
} else {
return(false);
}
}
return true;
}