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
Unknown Object (File)
Mon, Jun 27, 10:21 AM
Unknown Object (File)
Tue, Jun 21, 2:38 PM
Unknown Object (File)
Fri, Jun 10, 12:18 AM
Unknown Object (File)
May 29 2022, 7:26 AM
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.