Homec4science

Add encodeAsList to PhutilJSON and make formatting prettier

Authored by epriestley <git@epriestley.com> on Aug 4 2015, 22:05.

Description

Add encodeAsList to PhutilJSON and make formatting prettier

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:

{F688892}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7419, T8973

Differential Revision: https://secure.phabricator.com/D13787

Details

Committed
epriestley <git@epriestley.com>Aug 4 2015, 22:05
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUaa6cd8f7e5e5: Update cache key for class map query
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUb8420e193467: Add encodeAsList to PhutilJSON and make formatting prettier (authored by epriestley <git@epriestley.com>).Aug 4 2015, 22:05