Changeset View
Changeset View
Standalone View
Standalone View
src/parser/PhutilJSONParser.php
| Show All 10 Lines | final class PhutilJSONParser extends Phobject { | ||||
| private $allowDuplicateKeys = false; | private $allowDuplicateKeys = false; | ||||
| public function setAllowDuplicateKeys($allow_duplicate_keys) { | public function setAllowDuplicateKeys($allow_duplicate_keys) { | ||||
| $this->allowDuplicateKeys = $allow_duplicate_keys; | $this->allowDuplicateKeys = $allow_duplicate_keys; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function parse($json) { | public function parse($json) { | ||||
| $jsonlint_root = phutil_get_library_root('phutil').'/../externals/jsonlint'; | $arcanist_root = phutil_get_library_root('arcanist'); | ||||
| $jsonlint_root = $arcanist_root.'/../externals/jsonlint'; | |||||
| require_once $jsonlint_root.'/src/Seld/JsonLint/JsonParser.php'; | require_once $jsonlint_root.'/src/Seld/JsonLint/JsonParser.php'; | ||||
| require_once $jsonlint_root.'/src/Seld/JsonLint/Lexer.php'; | require_once $jsonlint_root.'/src/Seld/JsonLint/Lexer.php'; | ||||
| require_once $jsonlint_root.'/src/Seld/JsonLint/ParsingException.php'; | require_once $jsonlint_root.'/src/Seld/JsonLint/ParsingException.php'; | ||||
| require_once $jsonlint_root.'/src/Seld/JsonLint/Undefined.php'; | require_once $jsonlint_root.'/src/Seld/JsonLint/Undefined.php'; | ||||
| $parser = new JsonLintJsonParser(); | $parser = new JsonLintJsonParser(); | ||||
| try { | try { | ||||
| $output = $parser->parse($json, $this->getFlags()); | $output = $parser->parse($json, $this->getFlags()); | ||||
| Show All 35 Lines | |||||