1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 00:02:40 +01:00
No description
Find a file
epriestley 4b30319747 Make XHPAST parse-depth warning an actual warning.
Summary:
XHPAST encounters a parse-depth problem on some files because PHP
5.2 has an un-overridable parse depth limit for JSON. The text of this error
says it is a "warning" but we currently raise an error. Make it a warning
instead.

The JSON depth is 20 until PHP 5.2.3, where it becomes 128. After PHP 5.3
it defaults to 512 and is user-configurable, which will allow us to resolve
this issue in nearly all cases.

Since I made if/else express as a list in the AST, this only actually arises
in long binary chains, most commonly string concatenation, like:

  $out = 'a'.'a'.'a'.'a'...

...where each string is a variable or HTML tag and the program is constructing
a complicated document.

At some point I'll add some PHP 5.3 massaging to the XHPAST decoder itself to
raise this limit to something more huge.

Test Plan:
Ran "arc lint --lintall" on a file with a very deep binary
expression tree ("1 + 1 + 1 ...") and received a warning instead of an error.

Reviewed By: aran
Reviewers: pad, aran
CC: epriestley, aran
Differential Revision: 54
2011-03-07 11:44:11 -08:00
bin Initial commit. 2011-01-09 15:22:25 -08:00
externals Initial commit. 2011-01-09 15:22:25 -08:00
resources Basic 'shell-complete' workflow. 2011-01-17 20:18:27 -08:00
scripts Make 'arc' work for users without the POSIX PHP installed. 2011-03-03 16:11:03 -08:00
src Make XHPAST parse-depth warning an actual warning. 2011-03-07 11:44:11 -08:00
.arcconfig Align Arcanist against phabricator.com. 2011-02-09 20:45:39 -08:00
.divinerconfig Updated .divinerconfig. 2011-03-02 15:25:45 -08:00
.gitignore Basic doc config for arcanist. 2011-02-09 17:06:24 -08:00
LICENSE Initial commit. 2011-01-09 15:22:25 -08:00
README Initial commit. 2011-01-09 15:22:25 -08:00

PROJECT STATUS: CAVEAT EMPTOR

This is an unstable preview release. I'm open sourcing some of Facebook's
internal tools, but they'll be unstable for at least a couple months.
-epriestley


WHAT IS ARCANIST?

Arcanist is the CLI for Facebook's code review tool, Differential. Since
Differential isn't released yet, it may not be terribly useful on its own.