Download the PHP
package ottosmops/ocfl without Composer
On this page you can find all versions of the php package
ottosmops/ocfl. It is possible to download/install
these versions without Composer. Possible dependencies are resolved
automatically.
Vendor ottosmops Package ocfl Short Description PHP implementation of the Oxford Common File Layout (OCFL) v1.1 storage specification. License
MIT Homepage https://github.com/ottosmops/ocfl
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.
[](https://packagist.org/packages/ottosmops/ocfl)
[](https://packagist.org/packages/ottosmops/ocfl)
[](https://github.com/ottosmops/ocfl/actions/workflows/tests.yml)
[](https://packagist.org/packages/ottosmops/ocfl)
[](LICENSE)
`ottosmops/ocfl` is a PHP library for working with the [Oxford Common File
Layout (OCFL) v1.1](https://ocfl.io/1.1/spec/) — a storage specification for
long-term digital preservation.
It reads, writes, and validates OCFL objects against the local filesystem or
any [Flysystem](https://flysystem.thephpleague.com) v3 backend (S3, Azure,
GCS, in-memory, …).
## Features
- **Domain API** — readonly value objects for `Inventory`, `Version`, `User`,
`OcflObject`, `StorageRoot` — the whole spec modelled in types.
- **Read** — open an existing object, list versions, resolve logical paths to
content paths (respecting forward-delta dedup), stream content, or check
out an entire version to a directory.
- **Write** — create an object, commit new versions with content
`addFile` / `addContents`, `renameFile`, `removeFile`. Forward-delta dedup
and crash-safe staging (`.tmp-XXXX` → `rename`) handled automatically.
- **Storage layouts** — `0002-flat-direct-storage-layout` and
`0004-hashed-n-tuple-storage-layout` out of the box, with a pluggable
`StorageLayout` interface for custom extensions.
- **Validator** — rejects all 55 OCFL [bad-object fixtures](https://github.com/OCFL/fixtures)
with the correct spec-referenced error codes, accepts all 12 good-object
fixtures, and emits 13/13 warn-object advisories.
- **Pluggable storage** — `LocalFilesystem` by default; `FlysystemFilesystem`
adapter for any `league/flysystem` v3 backend (S3, Azure, GCS, …).
- **CLI** — `ocfl validate|info|list` for quick inspection from the shell,
with optional `--json` output for scripting.
- **Framework-agnostic** — zero required Composer runtime dependencies
beyond the PHP standard library. Laravel / Symfony wrappers are easy to
build on top.
## Requirements
- PHP 8.3 or later
- `ext-hash`, `ext-json`, `ext-mbstring`
Optional, for cloud storage:
- `league/flysystem` ^3.0 plus the adapter of your choice
## Installation
Tests run against the official [OCFL fixtures](https://github.com/OCFL/fixtures).
Clone with submodules:
## Quick start
### Creating an object
### Committing a new version
### Using a storage root with an id-to-path layout
### Checking out a version
### Validating an object
## Cloud storage via Flysystem
Any `league/flysystem` v3 filesystem can host an OCFL storage root.
Content digests are streamed, not buffered — large files never need to be
loaded into memory just to hash them.
## Command-line usage
A small `ocfl` binary is shipped in `bin/` (Composer installs it into
`vendor/bin/ocfl`).
`ocfl commit --from=` treats the source directory as the canonical
logical state of the next version: every file below `` becomes a
logical path, and any file in the previous version that no longer exists
in `` is removed. Content dedup is automatic.
Exit codes: `0` success · `1` object invalid · `2` usage error · `3` runtime
error. Colours are emitted by default; pipe through `| cat` to strip them.
## Laravel integration
The core package is framework-agnostic. For a Laravel app, wire it into
the container yourself — no second package needed:
Then anywhere in the app:
Artisan wrappers for `validate` / `list` can shell out to `vendor/bin/ocfl`
or call `Application::run()` directly.
## Validation status
The `ObjectValidator` emits OCFL-spec error and warning codes that link
directly to .
| Category | Coverage |
|----------|----------|
| Good-object fixtures | 12 / 12 validate with zero errors |
| Bad-object fixtures | **55 / 55** rejected with the documented error code |
| Warn-object fixtures | 13 / 13 emit the documented advisory |
Implemented error codes: `E001 E003 E007 E008 E010 E011 E013 E015 E017
E019 E023 E025 E033 E034 E036 E037 E038 E040 E041 E046 E048 E049 E050
E052 E053 E058 E060 E061 E063 E064 E066 E067 E070 E092 E093 E095 E096
E097 E099 E100 E101 E103 E107`.
Implemented warnings: `W001 W002 W004 W005 W007 W008 W009 W010 W011 W013`.
## Development
CI runs on Ubuntu and macOS against PHP 8.3 and 8.4. Current test suite:
**249 tests · 469 assertions · 94 % line coverage**; most remaining
uncovered lines are host-level I/O failure paths (mkdir-refused,
hash_file-on-special-file, etc.) that can't be triggered deterministically
in a unit test.
## References
- [OCFL 1.1 Specification](https://ocfl.io/1.1/spec/)
- [OCFL Implementation Notes](https://ocfl.io/1.1/implementation-notes/)
- [OCFL Validation Codes](https://ocfl.io/1.1/spec/validation-codes.html)
- [OCFL Community Extensions](https://ocfl.github.io/extensions/)
- [OCFL Fixtures](https://github.com/OCFL/fixtures) (used as test corpus)
- Related implementations: [ocfl-java](https://github.com/OCFL/ocfl-java),
[ocflcore](https://github.com/inveniosoftware/ocflcore) (Python),
[rocfl](https://github.com/pwinckles/rocfl) (Rust),
[gocfl](https://github.com/ocfl-archive/gocfl) (Go).
## License
See [LICENSE](LICENSE).
Requiresphp Version
^8.3 ext-hash Version
* ext-json Version
* ext-mbstring Version
*
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/ocfl contains the following files
Loading the files please wait ...
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.