PHP code example of mytree / index-providers

1. Go to this page and download the library: Download mytree/index-providers library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mytree / index-providers example snippets


use MyTree\IndexProviders\Http\DefaultHttpClientFactory;

$http = DefaultHttpClientFactory::create(
    timeoutSeconds: 60,
    maxAttempts: 3,
);

$provider = new GenetekaProvider(
    $myPsr18Client,
    $checkpointStore,
    $rawResponseStore,
    requestFactory: $myPsr17RequestFactory,
);

$stats = $provider
    ->acquisition()
    ->region('06mp')
    ->parish('4812', 'Imbramowice')
    ->recordType(RecordType::Birth)
    ->person('Gajda', 'Józef')
    ->years(1853, 1860)
    ->exact()
    ->acquire($writer);

$query = $query->formParameter('provider_field_name', 'value');

$availability = $provider->discoverAvailability(
    region: '10pl',
    anchorType: RecordType::Birth,
    anchorParishId: '4257',
);

$stats = $basia
    ->search()
    ->person('Kowalski', 'Jan')
    ->years(1880, 1900)
    ->place('Poznań', 10)
    ->recordType(RecordType::Birth)
    ->similarity(70)
    ->acquire($writer);

$units = $basia->listCatalogUnits();
$units = $basia->listCatalogUnits(refresh: true);
bash
php bin/mytree-index geneteka --availability \
  --region=10pl --parish-id=4257 --type=birth --format=json
bash
php bin/mytree-index basia --list-catalog
php bin/mytree-index basia --list-catalog --format=json
php bin/mytree-index basia --list-catalog --format=jsonl
bash
php bin/mytree-index geneteka --list-parishes --region=06mp
bash
php bin/mytree-index wolyn --list-parishes
bash
php bin/mytree-index geneteka --list-parishes --region=06mp --format=json
php bin/mytree-index wolyn --list-parishes --format=jsonl
php bin/mytree-index basia --list-catalog --format=json
bash
php bin/mytree-index wolyn --list-parishes --format=json --save=parishes-wolyn.json
php bin/mytree-index basia --list-catalog --format=json --save=basia-catalog.json
bash
php bin/mytree-index-view var/walenty-wisniewski-1863-1864