https://github.com/programarivm/pgn-chess
PGN Chess for PHP is a simple, friendly, and powerful PGN (Portable Game Notation) library for running chess games from within PHP applications. It is a chess board representation that can be used in chess engines, chess applications and chess algorithms.
A command line interface (CLI) is created with the aim to convert PGN files into MySQL scripts. More specifically, Feature/pgntosql implements the following two commands.
Creates a MySQL PGN Chess database:
php cli/createdb.php
This will remove the current PGN Chess database and the data will be lost.
Do you want to proceed? (Y/N): y
Converts a PGN file into a MySQL INSERT statement:
php cli/pgntomysql.php example.pgn > example.sql
Note:
pgntomysql.phpworks okay with a syntactically valid PGN file as a precondition.
A command that checks the syntax of PGN files has to be created in another PR.
pgnsyntax.phpFor further information visit section 4. Command Line Interface (CLI)
Contributions are welcome.
Many thanks.