whikloj/archivematica-php

A PHP client library for Archivematica

dev-main 2022-03-16 15:39 UTC

This package is auto-updated.

Last update: 2024-11-16 21:07:41 UTC


README

Minimum PHP Version Github Actions LICENSE codecov

Description

This is a PHP client library for interacting with an Archivematica instance. It requires PHP >= 7.3.

Installation

This library can installed using Composer with the command.

composer require whikloj/archivematicaPhp

Usage

The Archivematica client is made up a main ArchivematicaPhp resource and several other object types. These are described below:

ArchivematicaPhp

To instantiate an ArchivematicPhp instance you provide your Archivematica URL and your Storage Service URL. You will also need to set your username and API keys for either or both the Archivematica system and Storage Service.

$client = ArchivematicaPhp::create(
    "http://my-archivematica.example.org",
    "http://my-archivematica.example.org:62101"
)->setAMCreds(
    "archivematicaUser",
    "archivematicaApiKey"
)->setSSCreds(
    "storageServiceUser",
    "storageServiceApiKey"
);

Processing Config

You can request the current processing configuration from the server. It returns an XML document.

$config = $client->getProcessingConfig();

Other operations

Once you have an ArchivematicaPhp instance you can request any of the other objects but using their associated GET methods. ie.

  • Transfers - $client->getTransfer()
  • Ingests - $client->getIngest()
  • Packages - $client->getPackage()
  • Locations - $client->getLocation()
  • Spaces - $client->getSpace()
  • Pipelines - $client->getPipeline()