chesszebra / pgn-splitter
A PHP library to split PGN files into chunks per game or per section.
1.2.0
2019-11-23 09:33 UTC
Requires
- php: ^7.1
Requires (Dev)
- phpunit/phpunit: ^6.3
- squizlabs/php_codesniffer: ^3.0
This package is auto-updated.
Last update: 2024-11-23 20:31:49 UTC
README
A PHP library to split PGN files into chunks per game or per section.
Installation
Via composer:
composer require chesszebra/pgn-splitter
Usage
Split a stream per game:
use ChessZebra\Chess\Pgn\Splitter; $stream = fopen('my-games.pgn', 'r'); $splitter = new Splitter($stream, Splitter::SPLIT_GAMES); $splitter->split(function(string $buffer) { echo $buffer; });
Or split a stream per chunk (tags and moves chunks):
use ChessZebra\Chess\Pgn\Splitter; $stream = fopen('my-games.pgn', 'r'); $splitter = new Splitter($stream, Splitter::SPLIT_CHUNKS); $splitter->split(function(string $buffer) { echo $buffer; });
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please report them via HackerOne.
License
The MIT License (MIT). Please see License File for more information.