{"id":20782427,"url":"https://github.com/discoverygarden/flysystem_ocfl","last_synced_at":"2026-04-19T22:34:09.985Z","repository":{"id":195967555,"uuid":"593381670","full_name":"discoverygarden/flysystem_ocfl","owner":"discoverygarden","description":"Prototypical Flysystem adapter and supporting Drupal module for OCFL storage.","archived":false,"fork":false,"pushed_at":"2024-04-29T17:44:09.000Z","size":117,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-12-26T10:49:14.114Z","etag":null,"topics":["drupal","islandora","prototype"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/discoverygarden.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-25T21:36:12.000Z","updated_at":"2024-10-17T23:18:33.000Z","dependencies_parsed_at":"2024-05-04T00:00:29.362Z","dependency_job_id":null,"html_url":"https://github.com/discoverygarden/flysystem_ocfl","commit_stats":null,"previous_names":["discoverygarden/flysystem_ocfl"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/discoverygarden/flysystem_ocfl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discoverygarden%2Fflysystem_ocfl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discoverygarden%2Fflysystem_ocfl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discoverygarden%2Fflysystem_ocfl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discoverygarden%2Fflysystem_ocfl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/discoverygarden","download_url":"https://codeload.github.com/discoverygarden/flysystem_ocfl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/discoverygarden%2Fflysystem_ocfl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32025774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["drupal","islandora","prototype"],"created_at":"2024-11-17T14:11:02.009Z","updated_at":"2026-04-19T22:34:09.968Z","avatar_url":"https://github.com/discoverygarden.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flysystem OCFL\n\nA [Flysystem](https://www.drupal.org/project/flysystem) adapter implementation allowing access to within OCFL storage structures.\n\nPresently, 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.\n\n## Execution Overview\n\nOCFL storage is extensible at multiple levels:\n\n- the layout proper, how objects are placed within the storage root, supporting:\n  - [Flat Direct Storage](https://ocfl.github.io/extensions/0002-flat-direct-storage-layout.html)\n  - [Hashed Truncated N-tuple Trees with Encapsulating Directories](https://ocfl.github.io/extensions/0003-hash-and-id-n-tuple-storage-layout.html)\n  - [Hashed Truncated N-tuple Trees](https://ocfl.github.io/extensions/0004-hashed-n-tuple-storage-layout.html)\n  - [Flat Omit Prefix Storage](https://ocfl.github.io/extensions/0006-flat-omit-prefix-storage-layout.html)\n  - [N-tuple Omit Prefix Storage](https://ocfl.github.io/extensions/0007-n-tuple-omit-prefix-storage-layout.html)\n- the structure of objects themselves\n  - [Mutable HEAD](https://ocfl.github.io/extensions/0005-mutable-head.html)\n\nThe 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:\n- [Fedora OCFL Object Structure](https://wiki.lyrasis.org/display/FEDORA6x/Fedora+OCFL+Object+Structure); and,\n  - [Fedora Header Files](https://wiki.lyrasis.org/display/FEDORA6x/Fedora+Header+Files)\n\nTo support these multiple points of extensibility, we have defined:\n- for layouts: the `OCFLPlugin` plugin type, with base implementations of those presently defined extensions.\n  - We expect the layout to be specified in the `ocfl_layout.json` file in the root of the OCFL storage.\n    - 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.\n- for object structures: Event evaluation based on the `flysystem_ocfl.inventory_location` event\n  - 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.\n- for identifying target resources within objects: Event evaluation based on the `flysystem_ocfl.resource_location` event.\n  - 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.\n\n## Usage\n\nThis 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:\n\n```json\n{\n  \"fedora\": {\n    \"driver\": \"fedora\",\n    \"config\": {\n      \"root\": \"http://localhost:8080/fcrepo/rest/\"\n    }\n  }\n}\n```\n\nTo instead read directly from the OCFL storage layout, with something like:\n\n```json\n{\n  \"fedora\": {\n    \"driver\": \"ocfl\",\n    \"config\": {\n      \"root\": \"/opt/fcrepo/fcrepo/data/ocfl-root\",\n      \"id_prefix\": \"info:fedora/\"\n    }\n  }\n}\n```\n\nHypothetically, this could even be chained with another Flysystem implementation such as S3, such as:\n\n```json\n{\n  \"your-desired-scheme\": {\n    \"driver\": \"s3\",\n    \"config\": {\n      \"bucket\": \"your-ocfl-root-bucket\",\n    }\n  },\n  \"fedora\": {\n    \"driver\": \"ocfl\",\n    \"config\": {\n      \"root\": \"your-desired-scheme://ocfl-root\",\n      \"id_prefix\": \"info:fedora/\"\n    }\n  }\n}\n```\n\nNOTE: 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).\n\n### Configuration\n\nSee 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.\n\nThere are presently two points of configuration for the `ocfl` driver:\n\n| Key | Description | Default |\n| --- | --- | --- |\n| `root` | The base path targetting the OCFL root storage. | N/A (required) |\n| `id_prefix` | Prefix to add to incoming IDs. | the empty string |\n\n\n## Known Issues\n\nNot strictly an issue with this module, but may rise relating to the use of non-public filesystems in Drupal: https://www.drupal.org/project/drupal/issues/2786735\n\n## Future Thoughts\n\n- allow for fragments to be passed via Flysystem URIs, to be interpreted as different resources within a container object\n  - no present use-case for this\n\n## Troubleshooting/Issues\n\nHaving problems or solved a problem? Contact\n[discoverygarden](http://support.discoverygarden.ca).\n\n## Sponsors\n* University of Limerick\n\n## Maintainers\nCurrent maintainers:\n\n* [discoverygarden](http://www.discoverygarden.ca)\n\n## License\n[GPLv3](http://www.gnu.org/licenses/gpl-3.0.txt)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscoverygarden%2Fflysystem_ocfl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiscoverygarden%2Fflysystem_ocfl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiscoverygarden%2Fflysystem_ocfl/lists"}