Advanced Documentation With Reflection In PHP 5
Article Comments (2 total)
Nice article. Live generate documentation, interesting idea. Maybe the Extended Reflection API is something which is useful for this task (http://instantsvc.sourceforge.net/extended-reflection-api.php). It does parsing of docblocks and enhances the reflection API with a type system. It brings annotations to the PHP world, too.
In your article you mentioned the php_check_syntax() function. But in the current online documentation of this function is marked as deprecated. Did you know any other way to include a php-file with out running it's scripts?
Response from PhpRiot:
It may not be an ideal solution in that it's not natively PHP, but you could perhaps use the command line tool, such as the following:
$filename = '/path/to/script.php'; $cmd = sprintf('/usr/local/bin/php -l %s', escapeshellarg($filename); $output = trim(`$cmd`); ?>
Note the correct usage of backticks, and that you use the correct path to your CLI version of PHP.





This code is no longer valid. Function
php_check_syntax()has been removed from PHP since 5.0.5. See: http://www.php.net/manual/en/function.php-check-syntax.php.