HomeDevCentral

Offer debugger methods to dump a variable

Description

Offer debugger methods to dump a variable

Summary:
Import dprint_r and dieprint_r to the library.

These functions allow to enclose a print_r call in a preformatted block,
so the output could be read directly in a rendered HTML document.

They are intended to be used as debug time.

As these global functions are still in use during some current debug
and development tasks, we offer a mechanism to register them from the
Debugger class. As create_function is deprecated since PHP 7.2.0,
the selected method is to require a wrapper file in the global space.

The result is a choice between those two syntaxes:

Debugger::register();
dprint_r($someVariable);
Debugger::printVariable($someVariable);

Ref T1395

Test Plan:

  • unit test provided for the registration
  • integration tests provided for the debug methods

Reviewers: dereckson

Reviewed By: dereckson

Maniphest Tasks: T1395

Differential Revision: https://devcentral.nasqueron.org/D1614

Details

Provenance
derecksonAuthored on Apr 18 2018, 11:16
derecksonPushed on Apr 20 2018, 12:07
Reviewer
dereckson
Differential Revision
D1614: Offer debugger methods to dump a variable
Parents
rKOT12df4242155c: Provide string functions to search string start or end
Branches
Unknown
Tags
Unknown
Tasks
T1395: Migrate keruald/globalfunctions content to Keruald OmniTools