Enhancement
Static analysis in templates
Issue description
Currently the static analysis is limited to "pure" PHP files with a single PHP start tag in the beginning. Templates where markup/text intermix with PHP are currently not analysed. Generally it is a bit complicated as the initial root context in which they are executed is often hard to compute, in particular in the case of calls to "php" where the context is passed as second argument.
Developer comments
There is two types of PHP templates in use:
* A Topincs service is composed of a computational and a representational component, which are two separate PHP files executed together: computation is followed by optional representation. In the case of a GET service: GET.php computes the context in which GET.html can perform the output. GET.html runs in the same PHP context as GET.php. Therefore it can be treated just like any other PHP file, only it does not have to import or define anything. One can think that as concatenation of the two scripts.
* PHP templates are included with the [https://www.topincs.com/reference/php, php] function. Any call to php hands over the context to the template. In this case the call is at fault for not providing an argument for a parameter the template is expected. Therefore there is no undefined variables in such a template, but constants and functions do need to be provided by the calling script. Therefore it is possible that such a template works fine in script A and fails in script B.
The static analysis for these two types differs in profound ways.
|
Work sessions2
| Start |
2026-05-29T08:28:00
|
| End |
2026-05-29T11:00:00
|
| Participant |
Robert Cerny
|
|
We are sorry
This page cannot be displayed in your browser. Use Firefox, Opera, Safari, or Chrome instead.