Page MenuHomePhabricator

Add encodeAsList to PhutilJSON and make formatting prettier
ClosedPublic

Authored by epriestley on Aug 4 2015, 7:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 19, 6:36 AM
Unknown Object (File)
Mon, Dec 16, 10:27 AM
Unknown Object (File)
Sat, Dec 14, 5:51 AM
Unknown Object (File)
Wed, Dec 4, 8:56 PM
Unknown Object (File)
Nov 26 2024, 2:02 PM
Unknown Object (File)
Nov 22 2024, 4:51 PM
Unknown Object (File)
Nov 22 2024, 7:23 AM
Unknown Object (File)
Nov 21 2024, 3:13 PM
Subscribers
None

Details

Summary

Ref T8973. Ref T7419. Two issues:

  • In documenting T7419, I want to pretty print a JSON list value (an example value for lint and unit when calling harbormaster.sendmessage). Expose a public method for this.
  • T8973 discusses PHP's default behavior of escaping forward slashes in JSON. This is legal, but cumbersome. When pretty-printing for human users, disable it if we have a recent-enough PHP version.
Test Plan
  • See next diffs.
  • Pretty-printed lists with values that contain slashes, got friendly/helpful results:

Screen Shot 2015-08-04 at 12.27.12 PM.png (337×622 px, 38 KB)

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Add encodeAsList to PhutilJSON and make formatting prettier.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
chad edited edge metadata.
This revision is now accepted and ready to land.Aug 4 2015, 7:39 PM
This revision was automatically updated to reflect the committed changes.