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
Unknown Object (File)
Thu, Apr 11, 8:12 AM
Unknown Object (File)
Tue, Apr 9, 4:02 PM
Unknown Object (File)
Mon, Apr 8, 10:52 AM
Unknown Object (File)
Fri, Mar 22, 1:44 AM
Unknown Object (File)
Fri, Mar 22, 1:44 AM
Unknown Object (File)
Mar 18 2024, 8:22 AM
Unknown Object (File)
Feb 9 2024, 6:02 PM
Unknown Object (File)
Feb 9 2024, 6:02 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
Branch
master
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 2453
Build 2457: [Placeholder Plan] Wait for 30 Seconds

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