Skip to content
Stream Reader as php extension
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
sixdreams/StreamReader
stubs
tests
.gitignore
README.md
composer.json
composer.lock
config.json
phpunit.xml

README.md

StreamReader Collection

PHP XML Stream Reader

Reads XML from either a string or a stream, allowing the registration of callbacks when an elemnt is found that matches path.

Installation

  • Install Zephir
  • zephir build
  • Add extension=streamparser to your php.ini

Usage Example

<?php
declare(strict_types = 1);

$handle = \fopen(__DIR__ . 'games.xml', 'rb');

(new SixDreams\StreamReader\XmlStreamReader())
    ->registerCallback('/root/sport', '/root/sport/groups/group/events/event', function (string $rawXml) {
        echo 'XML: ' . $rawXml . "\n";
    })
    ->parse($handle);

\fclose($handle);

PHP JSON Stream Reader

@todo...

You can’t perform that action at this time.