HomePhabricator

Refactor `phutil_var_export`

Description

Refactor phutil_var_export

Summary:
Using regular expressions in phutil_var_export to prettify the output is a pretty bad idea (albeit it is something that we have been using for a while). PHP's var_export function is pretty simple conceptually and we can probably just construct the "exported" variable representation ourselves in most cases (and just call out to var_export in other cases).

It's a little weird to make a prettiness/complexity tradeoff in favor of prettiness here, but I think humans end up interacting with the generated files often enough that it's somewhat valuable to have them follow conventions and look like other files.

Test Plan: arc unit

Reviewers: epriestley, Blessed Reviewers

Reviewed By: epriestley, Blessed Reviewers

Subscribers: epriestley, Korvin

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

Details

Provenance
joshuaspenceAuthored on
joshuaspencePushed on Jul 20 2014, 11:18 PM
Reviewer
Blessed Reviewers
Differential Revision
D9935: Refactor `phutil_var_export`
Parents
rPHU754d02518c43: Minor change to `PhutilPygmentsSyntaxHighlighter`
Branches
Unknown
Tags
Unknown

Event Timeline