In the project I'm working on now, we are considering the possibility of placing system() in php. ini disable_functions . Now, one metamodem that ultimately will also fall prey to this restriction is syntax checking files with system("php -l"); calls system("php -l"); - prompting me to look for alternatives.
php_check_syntax() there, but not only this is not limited to just checking the syntax and including the file if it was syntactically valid, but was deleted from PHP 5.0.5. The manual suggests php -l instead, but provided that I am sure that disabling system call functions in PHP is a fairly common practice, I wonder if there is an accepted βbestβ way to check the syntax of PHP files from within PHP files.
(By the way, I am not inclined to this, but βnoβ is enough (and I hope that this is indeed so). We can exclude the module from this restriction - but I ask this question both out of curiosity and also in the hope of a more elegant solution .)
source share