PHPackages                             trellis-ldp/static-ldp - 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. [API Development](/categories/api)
4. /
5. trellis-ldp/static-ldp

ActiveProject[API Development](/categories/api)

trellis-ldp/static-ldp
======================

LDP Server for static assets

v0.8(6y ago)12242[2 PRs](https://github.com/trellis-ldp/static-ldp/pulls)Apache-2.0PHPPHP &gt;=7.1.0CI failing

Since Apr 11Pushed 5mo ago5 watchersCompare

[ Source](https://github.com/trellis-ldp/static-ldp)[ Packagist](https://packagist.org/packages/trellis-ldp/static-ldp)[ Docs](https://github.com/trellis-ldp/static-ldp)[ RSS](/packages/trellis-ldp-static-ldp/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (8)Dependencies (11)Versions (11)Used By (0)

static-ldp
==========

[](#static-ldp)

A simple way to expose static assets as a read-only [LDP](https://www.w3.org/TR/ldp/) server.

[![Minimum PHP Version](https://camo.githubusercontent.com/dcd4b4aec2c1709157fa6a2c050f709d75cde9552a79cfff0b70a97fad7281ae/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e312d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/dcd4b4aec2c1709157fa6a2c050f709d75cde9552a79cfff0b70a97fad7281ae/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e312d3838393242462e7376673f7374796c653d666c61742d737175617265)[![Build Status](https://github.com/trellis-ldp/static-ldp/workflows/GitHub%20CI/badge.svg)](https://github.com/trellis-ldp/static-ldp/workflows/GitHub%20CI/badge.svg)

Requirements
------------

[](#requirements)

- PHP 7.1+
- [Composer](https://getcomposer.org/)
- The [mbstring](http://php.net/manual/en/book.mbstring.php) extension
- The [pcre](http://php.net/manual/en/book.pcre.php) extension

Installation
------------

[](#installation)

To install `static-ldp`, follow these steps:

1. run `composer create-project trellis-ldp/static-ldp`
2. create a `./.env.local` file like this:

```
TRELLIS_SOURCE_DIR='/path/to/resources'

```

Basics
------

[](#basics)

By installing `static-ldp` and configuring the `TRELLIS_SOURCE_DIR` to point to the location of your static resources, you have a simple, read-only linked data server.

The web content will be served from the `./public` directory.

LDP Resources
-------------

[](#ldp-resources)

Individual files are served as `ldp:NonRDFSource` resources, and directories are served as `ldp:BasicContainer` resources. If a static file is a RDF file, then it is served as an `ldp:RDFSource`.

Describing LDP Non-RDF Resources
--------------------------------

[](#describing-ldp-non-rdf-resources)

It is also possible to describe an `ldp:NonRDFSource` via the `Link: ; rel="describedby"`header. For example, if a JPEG file is named `rosid_rosaceae.jpg`, then by adding an RDF file with the name `rosid_rosaceae.jpg.ttl` (or any valid RDF format such as `rosid_rosaceae.jpg.jsonld`), then requests to `rosid_rosaceae.jpg` will include a link header pointing to the `ldp:RDFSource`. Similarly, the `ldp:RDFSource` will contain a link header (`rel="describes"`) pointing to the `ldp:NonRDFSource`.

Support for instance digests
----------------------------

[](#support-for-instance-digests)

All resources support instance digests as defined in [RFC 3230](https://tools.ietf.org/html/rfc3230). What this means is that the response can include a `Digest` header so that it is possible to ensure end-to-end data integrity. Requests that include the header: `Want-Digest: md5` or `Want-Digest: sha1` will include responses that contain a digest corresponding to the on-disk resource.

Only `md5` and `sha1` algorithms are supported; other algorithms will be ignored. It should be noted that, for large files, `Want-Digest` requests may perform considerably slower, as the digest will need to be computed before a response is sent.

Configuration
-------------

[](#configuration)

There are many configuration options available. Only the `sourceDirectory` *must* be defined. Other options include:

```
template: default.twig

```

If you wish to override the HTML template with one of your own design, you can change this value to point to a different location. Alternately, you can edit the `default.twig` file in the `templates` directory. Though if you plan to customize the template, it is recommended that you use a separate file.

```
defaultRdfFormat: turtle

```

For requests without an `Accept` header, this is the RDF format used in responses (for `ldp:RDFSource` and `ldp:BasicContainer` resources).

```
contentDisposition: false

```

For `ldp:NonRDFSource` resources, this controls whether to include a `Content-Disposition`header in responses.

```
extraPropertiesFilename: properties

```

For each directory that becomes a `ldp:BasicContainer` resource, an RDF file within that directory with this name will have its contents added to the RDF presented as a response for that resource (instead of becoming a child resource in its own right). This provides a means by which to add user-controlled properties to `ldp:BasicContainer`s.

```
validRdfFormats:
    turtle:
        mimeType: text/turtle
        extension: ttl
    jsonld:
        mimeType: application/ld+json
        extension: jsonld
    ntriples:
        mimeType: application/n-triples
        extension: nt

```

Generally speaking, the RDF formats should not be changed unless there is a need to support a serialization that is not included here. The RDF format (e.g. `turtle`, `jsonld`) must be an RDF serialization format supported by [EasyRdf](http://www.easyrdf.org/).

```
prefixes:
    dc: "http://purl.org/dc/terms/"
    rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    ...

```

The default HTML display template will present IRIs in short (prefixed) form if those prefixes are registered. By default a number of common prefixes are included, but any prefix may be registered here.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance47

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~139 days

Total

8

Last Release

2387d ago

PHP version history (2 changes)v0.1PHP &gt;=5.6.0

v0.5PHP &gt;=7.1.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1265883?v=4)[Aaron Coburn](/maintainers/acoburn)[@acoburn](https://github.com/acoburn)

---

Top Contributors

[![acoburn](https://avatars.githubusercontent.com/u/1265883?v=4)](https://github.com/acoburn "acoburn (166 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (159 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (87 commits)")[![whikloj](https://avatars.githubusercontent.com/u/2857697?v=4)](https://github.com/whikloj "whikloj (14 commits)")[![ajs6f](https://avatars.githubusercontent.com/u/110994?v=4)](https://github.com/ajs6f "ajs6f (1 commits)")[![DiegoPino](https://avatars.githubusercontent.com/u/6946023?v=4)](https://github.com/DiegoPino "DiegoPino (1 commits)")

---

Tags

ldp-serverlinked-datardfldp

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/trellis-ldp-static-ldp/health.svg)

```
[![Health](https://phpackages.com/badges/trellis-ldp-static-ldp/health.svg)](https://phpackages.com/packages/trellis-ldp-static-ldp)
```

###  Alternatives

[kimai/kimai

Kimai - Time Tracking

4.8k8.7k1](/packages/kimai-kimai)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M524](/packages/shopware-core)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1175.2k](/packages/rcsofttech-audit-trail-bundle)[forumify/forumify-platform

122.0k12](/packages/forumify-forumify-platform)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1615.6k12](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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