Page MenuHomePhabricator

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

Authored by joshuaspence on Sep 6 2014, 7:26 AM.
Tags
None
Referenced Files
F13281619: D10435.diff
Sun, Jun 2, 11:00 AM
F13271268: D10435.diff
Wed, May 29, 7:06 PM
F13213364: D10435.diff
Fri, May 17, 7:40 AM
F13193948: D10435.id.diff
Sun, May 12, 7:42 PM
F13193891: D10435.diff
Sun, May 12, 6:55 PM
Unknown Object (File)
May 7 2024, 6:17 AM
Unknown Object (File)
May 3 2024, 3:59 AM
Unknown Object (File)
Apr 29 2024, 4:10 PM

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
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