PHP code example of survos / harvest-bundle

1. Go to this page and download the library: Download survos/harvest-bundle 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/ */

    

survos / harvest-bundle example snippets


$report = new \Survos\FolioBundle\Service\FolioDocumentStreamReport();
foreach ($source->documents('mistralHandwriting', keep: ['title', 'tags'], report: $report) as $item) {
    // Feed your index or database. Use rowId as the original source identity.
    $indexer->upsert($item['rowId'], $item);
}
if ($report->failed !== []) {
    // Handle incomplete input before replacing an index or deleting absent records.
    throw new \RuntimeException(json_encode($report->failed, JSON_THROW_ON_ERROR));
}