Download the PHP package staspiv/dgt-drv-php without Composer
On this page you can find all versions of the php package staspiv/dgt-drv-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package dgt-drv-php
Basic usage:
#!/usr/bin/env php
<?php
error_reporting(E_ALL & ~E_NOTICE);
use StasPiv\DgtDrvPhp\BufferAnalyzer\ChessAnalyzer;
use StasPiv\DgtDrvPhp\BufferAnalyzer\SomeNewHandler;
use StasPiv\DgtDrvPhp\Stream;
use StasPiv\DgtDrvPhp\StreamReader\DgtBoardStreamReader;
require_once 'vendor/autoload.php';
$stream = new Stream();
$streamReader = new DgtBoardStreamReader();
$chessAnalyzer = new ChessAnalyzer(
$stream,
new FenParser0x88(),
in_array('--rotated', $argv) ? 0 : 1,
in_array('--black', $argv) ? 'b' : 'w'
);
$streamReader->addAnalyzer($chessAnalyzer);
$stream->attach($streamReader);
// Now we can add handlers to ChessAnalyzer objects
// They should implement HandlerInterface with such methods
//
// public function handlePieceAdded(string $square, string $piece);
// public function handlePieceRemoved(string $square);
// public function handleBoardUpdated(string $newFen, &$updatedFen = null) : bool;
// public function handleLegalMoveCompleted(array $move, string $moveNotation, string $fenBefore, string $fenAfter) : bool ;
$handler = new SomeNewHandler();
$chessAnalyzer->addHandler($handler);
// Now start stream. $handler will receive all needed updates
$stream->start();All versions of dgt-drv-php with dependencies
PHP Build Version
Package Version
Requires
php Version
>7.2
chesscom/chess-game Version ~1.1
dhtmlgoodies/chessparser Version dev-master
symfony/process Version ^4.3
symfony/console Version ^4.3
textalk/websocket Version ^1.2
symfony/event-dispatcher Version ^4.3
chesscom/chess-game Version ~1.1
dhtmlgoodies/chessparser Version dev-master
symfony/process Version ^4.3
symfony/console Version ^4.3
textalk/websocket Version ^1.2
symfony/event-dispatcher Version ^4.3
The package staspiv/dgt-drv-php contains the following files
Loading the files please wait ...