Page MenuHomePhabricator

Convert all "include_once" warnings into exceptions in all PHP versions

Authored by epriestley on Oct 23 2017, 5:17 PM.



Fixes T12190. That task has a good description of the issue.

The old code kind of snuck by PHP5's rules to kind of get the right result. To make this work for PHP7, just wipe the error reporting entirely and explicitly convert any error messages into exceptions.

(This does not use pht() because it may run before pht() loads.)

Test Plan

Loaded a revision in PHP7 before D18723, saw an exception pointing at the implementation error.

Diff Detail

rPHU libphutil
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley created this revision.


PHP Fatal error: Call to undefined function error_clear_last() in /core/data/drydock/workingcopy-83/repo/libphutil/src/moduleutils/PhutilBootloader.php on line 225

This was introduced in PHP7 ¯\_(ツ)_/¯

  • Compare old and new errors instead, so the code is compatible with PHP5.
This revision is now accepted and ready to land.Oct 23 2017, 5:50 PM
This revision was automatically updated to reflect the committed changes.