2017 © Pedro Peláez
 

library xml-stream

Event driven reader for large XML files

image

gacek85/xml-stream

Event driven reader for large XML files

  • Thursday, October 27, 2016
  • by gacek85
  • Repository
  • 1 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Build Status, (*1)

XML Stream

  • Simple library for dealing with large XML lists., (*2)

  • Parses XML file chunk by chunk not loading the whole file to the memory and dispatches events informing about found node of given type., (*3)

  • The main component is the Gacek85\XML\Stream class which wraps all the dependent elemets., (*4)

``` php <?php, (*5)

use Gacek85\XML\Chunk\Provider as ChunkProvider; use Gacek85\XML\Node\Detector as NodeDetector; use Gacek85\XML\Node\Event\Event as NodeEvent; use Gacek85\XML\Node\Event\EventInterface; use Gacek85\XML\Node\Event\Feature\DOMElementProvider; use Gacek85\XML\Node\Event\Provider as EventProvider; use Gacek85\XML\Stream; use Symfony\Component\EventDispatcher\EventDispatcher;, (*6)

$eventProvider = (new EventProvider()) ->addFeatureProvider(new DOMElementProvider());, (*7)

$stream = new Stream( new EventDispatcher(), new ChunkProvider('/path/to/file.xml', 1024), // 2nd param is chunk length new NodeDetector(), $eventProvider );, (*8)

$stream ->getDispatcher() ->addListener(EventInterface::NAME, function (NodeEvent $ev) { // Do your stuff here });, (*9)

$stream->read('listNodeName'); ```, (*10)

The Versions

27/10 2016

dev-feature/refactor

dev-feature/refactor

Event driven reader for large XML files

  Sources   Download

The Requires

 

The Development Requires

by Maciej Garycki

27/10 2016

dev-master

9999999-dev

Event driven reader for large XML files

  Sources   Download

The Requires

 

The Development Requires

by Maciej Garycki

27/10 2016

dev-develop

dev-develop

Event driven reader for large XML files

  Sources   Download

The Requires

 

The Development Requires

by Maciej Garycki

27/10 2016

1.0.0

1.0.0.0

Event driven reader for large XML files

  Sources   Download

The Requires

 

The Development Requires

by Maciej Garycki

14/10 2016

dev-feature/more-tests

dev-feature/more-tests

Event driven reader for large XML files

  Sources   Download

The Requires

 

The Development Requires

by Maciej Garycki