Page MenuHomePhabricator

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

Authored by epriestley on Oct 23 2017, 5:17 PM.
Tags
None
Referenced Files
F14006869: D18724.id44949.diff
Mon, Oct 28, 7:40 PM
F13995530: D18724.id44944.diff
Wed, Oct 23, 1:37 PM
F13985427: D18724.id44945.diff
Sun, Oct 20, 8:27 PM
F13957906: D18724.id44944.diff
Oct 14 2024, 11:58 AM
F13957187: D18724.id44944.diff
Oct 14 2024, 9:00 AM
Unknown Object (File)
Oct 9 2024, 5:58 AM
Unknown Object (File)
Sep 27 2024, 11:48 PM
Unknown Object (File)
Sep 23 2024, 8:00 PM
Subscribers
None

Details

Summary

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

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley created this revision.

uhhh

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.