Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/christophwurst/kitinerary-bin

php binding to invoke a shipped kitinerary-extractor binary
https://github.com/christophwurst/kitinerary-bin

Last synced: 2 months ago
JSON representation

php binding to invoke a shipped kitinerary-extractor binary

Awesome Lists containing this project

README

        

# kitinerary-bin

Binary executable adapter for the [kitinerary extractor package](https://packagist.org/packages/christophwurst/kitinerary). This package provides an adapter that invokes a shipped [kitinerary-extractor](https://github.com/KDE/itinerary) executable on x86_64 Linux systems.

The statically linked binary is created [from source](https://invent.kde.org/vkrause/kitinerary-static-build).

## Installation

```sh
composer require christophwurst/kitinerary christophwurst/kitinerary-bin
```

## Usage

```php
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) {
// ...
}
```