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)
Tue, Dec 24, 1:56 PM
Unknown Object (File)
Sun, Dec 22, 7:32 AM
Unknown Object (File)
Mon, Dec 16, 11:42 PM
Unknown Object (File)
Fri, Dec 13, 4:19 PM
Unknown Object (File)
Wed, Dec 11, 10:51 AM
Unknown Object (File)
Tue, Dec 10, 1:39 PM
Unknown Object (File)
Mon, Dec 9, 4:37 PM
Unknown Object (File)
Mon, Dec 9, 4:37 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.