Download the PHP package ottosmops/oai-pmh without Composer

On this page you can find all versions of the php package ottosmops/oai-pmh. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package oai-pmh

ottosmops/oai-pmh

Latest Version on Packagist Tests Coverage Total Downloads PHP Version Require

A Laravel-native OAI-PMH 2.0 server. Ships the protocol framework — verb dispatching, resumption tokens, Blade views, XML envelope — and leaves the domain-specific mapping to your repository implementations.

Implements every requirement of the OAI-PMH 2.0 specification including all eight error codes, deleted-record tombstones, set hierarchy, date-granularity rules, and resumption-token pagination with completeListSize + cursor attributes. XSD-conformance test suite validates every response against the upstream schema.

Originally developed in collaboration with the Gosteli Archive – History of women's movements in Switzerland (University Library Bern; archive database at gosteli.anton.ch), within the Anton archive management system, and later extracted so that other archives can reuse the underlying protocol framework.

Requirements

Installation

Publish the config (optional — sensible defaults ship in-package):

Publish the Blade views (optional — only if you need to customise the XML output, e.g. add a custom XSI schema on the root element):

Quickstart

1. Implement a repository

Repositories fetch records from your data source. The package handles the protocol (pagination, tokens, errors, XML) — you just return records.

2. Register the repository

In config/oai-pmh.php:

3. Register the route

In routes/web.php:

Or, if you want the package to register the default route for you:

4. Harvest

Configuration reference

Key Type Default Purpose
repository_name string null <repositoryName> in Identify
admin_email string|string[] null One or more <adminEmail>
sample_identifier string|Closure null Example identifier shown in the oai-identifier description
granularity string YYYY-MM-DDThh:mm:ssZ Date granularity per §3.3
deletedRecord string no no | persistent | transient
limit int 50 ListRecords page size
limit_identifier int 200 ListIdentifiers page size (headers only)
metadataFormats array [] Keyed by metadataPrefix; each entry has repository, schema, namespace
sets array [] Each entry has spec, name, optional description
friends array [] Optional OAI-PMH friend repository base URLs
earliestDatestamp ?string null Fallback when no repository can supply one

Customising views

Run vendor:publish --tag=oai-pmh-views, then edit resources/views/vendor/oai-pmh/*.blade.php. Views receive the following data (full shape in the verb handlers under src/Http/Controllers/Verbs/):

View Data
identify.blade.php repositoryName, adminEmails, earliestDatestamp, deletedRecord, granularity, sampleIdentifier, friends
error.blade.php errors (array of [code, message])
get-record.blade.php record (Record), metadataPrefix
list-records.blade.php records, metadataPrefix, token, cursor, completeListSize
list-identifiers.blade.php records, token, cursor, completeListSize
list-metadata-formats.blade.php formats (array of MetadataPrefix)
list-sets.blade.php sets (array from config)

All views also receive $responseDate, $requestAttributes, $baseUrl.

Deleted records

To expose a deleted record per §2.5.1 (modes persistent / transient):

The view emits <header status="deleted"> with identifier + datestamp, and no <metadata> element.

Testing your repository

The package ships a minimal in-memory fixture (tests/Fixtures/InMemoryRepository) you can reuse in your own test suite to wire things up before writing your real repository.

Real-world example

Anton's archive-management system uses this package with two repositories:

License

MIT


All versions of oai-pmh with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0 || ^11.0 || ^12.0
illuminate/http Version ^10.0 || ^11.0 || ^12.0
illuminate/view Version ^10.0 || ^11.0 || ^12.0
illuminate/contracts Version ^10.0 || ^11.0 || ^12.0
nesbot/carbon Version ^2.0 || ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ottosmops/oai-pmh contains the following files

Loading the files please wait ...