-
Improvement
-
Resolution: Fixed
-
Medium
-
None
This is a suggestion to establish a new rule: "Every file with .php extension must have correct PHP syntax (in other words, it must pass php -l). If there is a reason (eg for unit tests) to have a PHP file with broken syntax, it must have different extension."
Such a rule would be enforced by a new pre-release step in the integration chain. Something like the following shell in Jenkins:
#!/bin/bash -e
|
|
find -L ${pathtomoodle} -name 'index.php' -print0 | xargs -0 -n 1 -P 4 php -l
|
It ends with return status 0 (success) if no syntax error is detected. It stops with the return status >0 otherwise and Jenkins marks such a build as a failure.
- blocks
-
MDLSITE-3651 Add php_lint to prechecker
-
- Resolved
-
- has a non-specific relationship to
-
MDLSITE-2338 Advanced php syntax checker
-
- Open
-
- has been marked as being related by
-
MDL-48204 syntax error in mod/wiki/admin.php
-
- Closed
-