PHP code example of unhplace / fedora-ingest
1. Go to this page and download the library: Download unhplace/fedora-ingest 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/ */
unhplace / fedora-ingest example snippets
php
use UNHPlace\FedoraIngest\FedoraCollection;
// Create a new collection with a named slug
$col = FedoraCollection('col-1');
// Set the local path for binaries
$col->setBinaryPath('data');
// CSV source
$col->ingestCsv('csv/metadata.csv');
// FGDC XML source
$col->ingestFgdcXml('xml/*.xml');
// Print the URI of the created collection
echo $col->getUri();
// Print the number of child objects
echo count( $col->getChildren());