PHPackages                             discoverygarden/flysystem\_ocfl - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. discoverygarden/flysystem\_ocfl

ActiveDrupal-module[File &amp; Storage](/categories/file-storage)

discoverygarden/flysystem\_ocfl
===============================

v1.1.0(2y ago)131GPL-3.0-or-laterPHP

Since Mar 21Pushed 2y ago6 watchersCompare

[ Source](https://github.com/discoverygarden/flysystem_ocfl)[ Packagist](https://packagist.org/packages/discoverygarden/flysystem_ocfl)[ RSS](/packages/discoverygarden-flysystem-ocfl/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

Flysystem OCFL
==============

[](#flysystem-ocfl)

A [Flysystem](https://www.drupal.org/project/flysystem) adapter implementation allowing access to within OCFL storage structures.

Presently, targeting read-only access to binaries in [FCRepo 6 flavored storage](https://wiki.lyrasis.org/display/FEDORA6x/Fedora+OCFL+Object+Structure), especially via the lens of [Islandora](https://github.com/Islandora/islandora) which concerns primarily the storage of binaries.

Execution Overview
------------------

[](#execution-overview)

OCFL storage is extensible at multiple levels:

- the layout proper, how objects are placed within the storage root, supporting:
    - [Flat Direct Storage](https://ocfl.github.io/extensions/0002-flat-direct-storage-layout.html)
    - [Hashed Truncated N-tuple Trees with Encapsulating Directories](https://ocfl.github.io/extensions/0003-hash-and-id-n-tuple-storage-layout.html)
    - [Hashed Truncated N-tuple Trees](https://ocfl.github.io/extensions/0004-hashed-n-tuple-storage-layout.html)
    - [Flat Omit Prefix Storage](https://ocfl.github.io/extensions/0006-flat-omit-prefix-storage-layout.html)
    - [N-tuple Omit Prefix Storage](https://ocfl.github.io/extensions/0007-n-tuple-omit-prefix-storage-layout.html)
- the structure of objects themselves
    - [Mutable HEAD](https://ocfl.github.io/extensions/0005-mutable-head.html)

The exact use of the OCFL storage is still up to the application proper, which may have different suggestions as to how objects should be structured, such as:

- [Fedora OCFL Object Structure](https://wiki.lyrasis.org/display/FEDORA6x/Fedora+OCFL+Object+Structure); and,
    - [Fedora Header Files](https://wiki.lyrasis.org/display/FEDORA6x/Fedora+Header+Files)

To support these multiple points of extensibility, we have defined:

- for layouts: the `OCFLPlugin` plugin type, with base implementations of those presently defined extensions.
    - We expect the layout to be specified in the `ocfl_layout.json` file in the root of the OCFL storage.
        - Strictly, per the [OCFL spec](https://ocfl.io/1.0/spec/#root-structure), this file is optional; however, having it present greatly simplifies the loading of the layout plugin.
- for object structures: Event evaluation based on the `flysystem_ocfl.inventory_location` event
    - This allows the "Mutable HEAD" extension to inject its bit of indirection, but allows falling back to the base location of an `inventory.json` sitting in the objects' root directory.
- for identifying target resources within objects: Event evaluation based on the `flysystem_ocfl.resource_location` event.
    - This allows the targeting of resources in the object, especially in the Fedora Commons 6 instance of which Islandora makes extensive use, where the object is based off of a singular "binary" resource, where fetching the object in certain instances (such as ours) is best interpreted as acquiring the byte-stream of the file.

Usage
-----

[](#usage)

This should offer a similar parallel to the `fedora` driver shipped with `islandora/islandora`, which might be configured via your Drupal site's `settings.php` with something like:

```
{
  "fedora": {
    "driver": "fedora",
    "config": {
      "root": "http://localhost:8080/fcrepo/rest/"
    }
  }
}
```

To instead read directly from the OCFL storage layout, with something like:

```
{
  "fedora": {
    "driver": "ocfl",
    "config": {
      "root": "/opt/fcrepo/fcrepo/data/ocfl-root",
      "id_prefix": "info:fedora/"
    }
  }
}
```

Hypothetically, this could even be chained with another Flysystem implementation such as S3, such as:

```
{
  "your-desired-scheme": {
    "driver": "s3",
    "config": {
      "bucket": "your-ocfl-root-bucket",
    }
  },
  "fedora": {
    "driver": "ocfl",
    "config": {
      "root": "your-desired-scheme://ocfl-root",
      "id_prefix": "info:fedora/"
    }
  }
}
```

NOTE: An additional prefix within the bucket (`ocfl-root` in the example above, but could be anything) is presently necessary, due to [naive path normalization in Flysystem](https://github.com/thephpleague/flysystem/blob/3239285c825c152bcc315fe0e87d6b55f5972ed1/src/Adapter/AbstractAdapter.php#L49-L59).

### Configuration

[](#configuration)

See the [Flysystem module documentation](https://git.drupalcode.org/project/flysystem/-/blob/2.0.x/README.md#configuration) for more in-depth context on Flysystem adapter configuration.

There are presently two points of configuration for the `ocfl` driver:

KeyDescriptionDefault`root`The base path targetting the OCFL root storage.N/A (required)`id_prefix`Prefix to add to incoming IDs.the empty stringKnown Issues
------------

[](#known-issues)

Not strictly an issue with this module, but may rise relating to the use of non-public filesystems in Drupal:

Future Thoughts
---------------

[](#future-thoughts)

- allow for fragments to be passed via Flysystem URIs, to be interpreted as different resources within a container object
    - no present use-case for this

Troubleshooting/Issues
----------------------

[](#troubleshootingissues)

Having problems or solved a problem? Contact [discoverygarden](http://support.discoverygarden.ca).

Sponsors
--------

[](#sponsors)

- University of Limerick

Maintainers
-----------

[](#maintainers)

Current maintainers:

- [discoverygarden](http://www.discoverygarden.ca)

License
-------

[](#license)

[GPLv3](http://www.gnu.org/licenses/gpl-3.0.txt)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 67.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~117 days

Total

3

Last Release

911d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ed79bbc35ed0aaee2f603c6f16885fb01e203941eea0cd63013f9f6185df6c30?d=identicon)[adam-vessey](/maintainers/adam-vessey)

![](https://www.gravatar.com/avatar/49d799e416ff30e90b07d1b7b6a487dfe945ae884c53747de4724439965d7904?d=identicon)[lutaylor](/maintainers/lutaylor)

![](https://www.gravatar.com/avatar/454136e389341c2a9c22dfba3107e09e2f8653807185bb213c5272efa9b93864?d=identicon)[willtp87](/maintainers/willtp87)

---

Top Contributors

[![adam-vessey](https://avatars.githubusercontent.com/u/607975?v=4)](https://github.com/adam-vessey "adam-vessey (39 commits)")[![JojoVes](https://avatars.githubusercontent.com/u/19390668?v=4)](https://github.com/JojoVes "JojoVes (7 commits)")[![nchiasson-dgi](https://avatars.githubusercontent.com/u/53783039?v=4)](https://github.com/nchiasson-dgi "nchiasson-dgi (6 commits)")[![willtp87](https://avatars.githubusercontent.com/u/688918?v=4)](https://github.com/willtp87 "willtp87 (4 commits)")[![bibliophileaxe](https://avatars.githubusercontent.com/u/18718388?v=4)](https://github.com/bibliophileaxe "bibliophileaxe (1 commits)")[![lutaylor](https://avatars.githubusercontent.com/u/2863794?v=4)](https://github.com/lutaylor "lutaylor (1 commits)")

---

Tags

drupalislandoraprototype

### Embed Badge

![Health badge](/badges/discoverygarden-flysystem-ocfl/health.svg)

```
[![Health](https://phpackages.com/badges/discoverygarden-flysystem-ocfl/health.svg)](https://phpackages.com/packages/discoverygarden-flysystem-ocfl)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M123](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M61](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
