prewk / xml-string-streamer-guzzle
Stream provider for Guzzle for use with xml-string-streamer
Installs: 298 433
Dependents: 3
Suggesters: 0
Security: 0
Stars: 16
Watchers: 2
Forks: 7
Open Issues: 2
Requires
- php: >=7.2.0
- guzzlehttp/guzzle: ~7.0
- prewk/xml-string-streamer: >=0.13.0
Requires (Dev)
- mockery/mockery: ^1.3
- phpunit/phpunit: 8.*
README
Use with xml-string-streamer
What is it?
Streams large XML files with low memory consumption, over HTTP using Guzzle.
Installing
Run composer require prewk/xml-string-streamer-guzzle
to install this package.
Examples
use Prewk\XmlStringStreamer; use Prewk\XmlStringStreamer\Stream; use Prewk\XmlStringStreamer\Parser; $url = "http://example.com/really-large-xml-file.xml"; $CHUNK_SIZE = 1024; $stream = new Stream\Guzzle($url, $CHUNK_SIZE); $parser = new Parser\StringWalker(); $streamer = new XmlStringStreamer($parser, $stream); while ($node = $streamer->getNode()) { // ... }
For more info, see the xml-string-streamer repo.
Compatibility
- For PHP >= 5.5 with Guzzle 6 compatibility, use version
0.4.0
- For PHP >= 7.2 with Guzzle 7 compatibility, use latest (
1.0.0
and onwards)