2017 © Pedro Peláez
 

library jsonstreamingparser

A streaming parser for JSON in PHP.

image

andig/jsonstreamingparser

A streaming parser for JSON in PHP.

  • Wednesday, September 16, 2015
  • by andig
  • Repository
  • 1 Watchers
  • 0 Stars
  • 59 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 48 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Build Status, (*1)

Not invented here

Code forked from https://github.com/salsify/jsonstreamingparser and some fixed added:, (*2)

  • Removed file_position callback from listener (we did not need it and it gave significant performance boost)
  • PSR2

Features

  • Stream based - low memory footprint does not grow with file size
  • Similar to SAX parser

Known drawbacks

  • Performance is not as good as it should be (throughput - ~1MB per 9 secs, VirtualBox, Debian 7 on 4.3GHz CPU, single core)

Usage

To use the JsonStreamingParser you just have to implement the JsonStreamingParser\Listener interface. You then pass your Listener into the parser. For example:, (*3)

$stream = fopen('doc.json', 'r');
$listener = new YourListener();
try {
  $parser = new Parser($stream, $listener);
  $parser->parse();
} catch (Exception $e) {
  fclose($stream);
  throw $e;
}

That's it! Your Listener will receive events from the streaming parser as it works., (*4)

License

MIT License, (*5)

The Versions

16/09 2015

dev-master

9999999-dev https://github.com/andig/jsonstreamingparser

A streaming parser for JSON in PHP.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

by Maxim Gnatenko

parser json streaming

15/09 2015

dev-fix

dev-fix https://github.com/salsify/jsonstreamingparser

A streaming parser for JSON in PHP.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

by Maxim Gnatenko

parser json streaming

04/07 2014

v4.0.0

4.0.0.0 https://github.com/salsify/jsonstreamingparser

A streaming parser for JSON in PHP.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

by Maxim Gnatenko

parser json streaming

28/05 2014

v3.0

3.0.0.0 https://github.com/salsify/jsonstreamingparser

A streaming parser for JSON in PHP.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

by Maxim Gnatenko

parser json streaming

13/12 2013

v2.0

2.0.0.0 https://github.com/salsify/jsonstreamingparser

A streaming parser for JSON in PHP.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

by Maxim Gnatenko

parser json streaming

31/10 2013

v1.0

1.0.0.0 https://github.com/salsify/jsonstreamingparser

A streaming parser for JSON in PHP.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

by Maxim Gnatenko

parser json streaming