biigle/ifdo

iFDO Parser Package to parse and validate the iFDO JSON Schema

Installs: 4 617

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

pkg:composer/biigle/ifdo

v1.0.1 2024-11-07 13:46 UTC

This package is auto-updated.

Last update: 2025-10-07 15:52:20 UTC


README

A PHP package to read and validate iFDO v2 files.

Installation

composer require biigle/ifdo

Usage

use Biigle\Ifdo\Ifdo;

$path = __DIR__ . '/fixtures/ifdo-test-v2.0.0.json';
$obj  = Ifdo::fromFile($path);

// print errors to console if document is no valid
$obj->setDebug(true);

// check if document is valid
$obj->isValid();

// get list of errors if there are any
$obj->getErrors();

// get full json as array
$obj->getJsonData();

// shorthands to safely access info
$obj->getImageSetHeader();
$obj->getImageSetItems();

// use strict mode trigger exceptions for invalid files
$obj = Ifdo::fromString('{"some": "json"}', true);

// get json encoded string
$obj->toString();

Testing

composer test