Homec4science

Refactor `phutil_var_export`

Authored by Joshua Spence <josh@joshuaspence.com> on Jul 21 2014, 01:18.

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

Committed
Joshua Spence <josh@joshuaspence.com>Jul 21 2014, 01:18
Pushed
aubortMar 17 2017, 12:03
Parents
rPHU754d02518c43: Minor change to `PhutilPygmentsSyntaxHighlighter`
Branches
Unknown
Tags
Unknown

Event Timeline

Joshua Spence <josh@joshuaspence.com> committed rPHUb01ea402d92a: Refactor `phutil_var_export` (authored by Joshua Spence <josh@joshuaspence.com>).Jul 21 2014, 01:18