Page MenuHomePhabricator

Patch the `JSONLint` external to be compatible with PHP 5.2
ClosedPublic

Authored by joshuaspence on Sep 6 2014, 7:26 AM.

Details

Summary

The JSONLint external utilizes the shorthand ternary (?:) syntax, which is only available from PHP 5.3. Expand the shorthand ternary form into ordinary ternary form to ensure compatibility with PHP 5.2. Depends on D10433.

Test Plan

Not sure how...

Diff Detail

Repository
rPHU libphutil
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

joshuaspence retitled this revision from to Patch the `JSONLint` external to be compatible with PHP 5.2.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.
This revision is now accepted and ready to land.Sep 8 2014, 1:50 PM

This causes Phabricator to blow up on our install
Call to undefined method JsonLintLexer::len()
callstack:

...
phutil_json_decode() /Users/tal/dev/phabricator/phabricator/src/applications/differential/customfield/DifferentialAuditorsField.php:24
PhutilJSONParser->parse() /Users/tal/dev/phabricator/libphutil/src/utils/utils.php:1053
JsonLintJsonParser->parse() /Users/tal/dev/phabricator/libphutil/src/parser/PhutilJSONParser.php:27
JsonLintJsonParser->lex() /Users/tal/dev/phabricator/libphutil/externals/jsonlint/src/Seld/JsonLint/JsonParser.php:178

Our php:

PHP 5.4.24 (cli) (built: Jan 19 2014 21:32:15) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies