christophwurst/kitinerary-bin

KItinerary binary executable

v0.4.1 2023-07-24 13:38 UTC

README

Binary executable adapter for the kitinerary extractor package. This package provides an adapter that invokes a shipped kitinerary-extractor executable on x86_64 Linux systems.

The statically linked binary is created from source.

Installation

composer require christophwurst/kitinerary christophwurst/kitinerary-bin

Usage

use ChristophWurst\KItinerary\ItineraryExtractor;
use ChristophWurst\KItinerary\Bin\BinaryAdapter;
use ChristophWurst\KItinerary\Exception\KItineraryRuntimeException;

$adapter = new BinaryAdapter();
if (!$adapter->isAvailable()) {
    // ...
}
$extractor = new Extractor($adapter);

try {
    $itinerary = $extractor->extractFromString('...');
} catch (KItineraryRuntimeException $e) {
    // ...
}