-
Sub-task
-
Resolution: Won't Fix
-
Minor
-
None
-
2.2.2
-
None
-
-
MOODLE_22_STABLE
If you do this code:
// Optional OU references support
|
@include_once($CFG->dirroot- .- '/local/references/oucontent_assets.php');
|
you get an error:
819: File is being unconditionally included; use "require_once" instead
In this case I am specifically including the file conditionally - in other words, I am happy for the file not to exist, that is why I am doing include_once instead of require_once. If the code doesn't exist, I don't want an error.
I see what the test is for but I think there should be an exception if you use the @ symbol (which is necessary in this case, otherwise you get a warning when it doesn't exist) which indicates that you have considered that it might not exist. In other words if you do include_once you should still get this error but if you do @include_once this should be allowed.