https://github.com/opensoft/json-streaming-parser
PSR-7 json streaming parser
https://github.com/opensoft/json-streaming-parser
Last synced: about 1 year ago
JSON representation
PSR-7 json streaming parser
- Host: GitHub
- URL: https://github.com/opensoft/json-streaming-parser
- Owner: opensoft
- License: mit
- Created: 2016-02-15T13:25:01.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-05-31T16:23:12.000Z (about 7 years ago)
- Last Synced: 2025-04-16T05:44:23.591Z (about 1 year ago)
- Language: PHP
- Size: 17.6 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
PSR7 Streaming JSON Parser
=========================
This is a PSR-7 streaming parser for processing large JSON documents.
Based on cool [php-streaming-json-parser](https://github.com/salsify/jsonstreamingparser).
Original parser was improved to use PSR-7 StreamInterface and now it is a bundle for Symfony2.
Also a lot of changes in naming and style. Feel free to address the original documentation because lots of core things are the same.
Usage
-----
To use the `JsonStreamingParser` you just have to implement the `Opensoft\JsonStreamingParserBundle\Listener\ListenerInterface`.
Then you pass your listener into the parser. For example:
```php
$listener = new YourListener();
//$someStream is an object of class which implements PSR-7 StreamInterface
//example in src/Opensoft/Tests/Data/Stream.php
$parser = new \JsonStreamingParserBundle\Parser($someStream, $listener);
$parser->parse();
```
Your listener will receive events from the streaming parser as it works.
License
-------
[MIT License](http://mit-license.org/) (c) Opensoft.