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)
Fri, Apr 12, 9:19 AM
Unknown Object (File)
Thu, Apr 4, 10:23 AM
Unknown Object (File)
Thu, Apr 4, 8:05 AM
Unknown Object (File)
Mar 16 2024, 2:27 AM
Unknown Object (File)
Feb 14 2024, 1:35 PM
Unknown Object (File)
Feb 13 2024, 2:26 PM
Unknown Object (File)
Feb 3 2024, 3:54 AM
Unknown Object (File)
Jan 6 2024, 7:01 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
Branch
warn1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 18724
Build 25229: Run Core Tests
Build 25228: arc lint + arc unit

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.